Skip to content

Commit

Permalink
reduce extranous logging
Browse files Browse the repository at this point in the history
  • Loading branch information
aditsachde committed Sep 28, 2024
1 parent 8a1bd5c commit 954b284
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
4 changes: 0 additions & 4 deletions cmd/fastly-monitor/main.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
package main

import (
"log"
"os"

"github.com/fastly/compute-sdk-go/fsthttp"
"itko.dev/internal/ctmonitor"
)

func main() {
log.Println("FASTLY_SERVICE_VERSION:", os.Getenv("FASTLY_SERVICE_VERSION"))
fsthttp.ServeFunc(ctmonitor.FastlyServe)
}
3 changes: 0 additions & 3 deletions internal/ctmonitor/fastly.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ func FastlyServe(ctx context.Context, w fsthttp.ResponseWriter, r *fsthttp.Reque

func FastlyWrapper(wrapped func(ctx context.Context, reqBody io.ReadCloser, query url.Values) (resp []byte, code int, err error)) func(c context.Context, w fsthttp.ResponseWriter, r *fsthttp.Request) {
return func(c context.Context, w fsthttp.ResponseWriter, r *fsthttp.Request) {
log.Println("Path:", r.URL.Path, "Method:", r.Method, "Query:", r.URL.Query())

query := r.URL.Query()
resp, code, err := wrapped(c, r.Body, query)

Expand Down Expand Up @@ -112,7 +110,6 @@ func (f *FastlyStorage) Get(ctx context.Context, key string) (data []byte, notfo

cacheFunc := func() (simple.CacheEntry, error) {
f.requests++
fmt.Println("Request count:", f.requests)

req, err := fsthttp.NewRequest("GET", url, nil)
req.CacheOptions = fsthttp.CacheOptions{
Expand Down

0 comments on commit 954b284

Please sign in to comment.