From 8bf2e7b6871630cb22c00a857859a63c0b15c335 Mon Sep 17 00:00:00 2001 From: Tordarus Date: Sun, 2 Feb 2025 10:59:05 +0100 Subject: [PATCH] remove debug logs and panic if auto refresh failed --- main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 64c3f50..09c9ac5 100644 --- a/main.go +++ b/main.go @@ -50,7 +50,11 @@ func main() { panic(err) } - go api.AutoRefresh(context.Background()) + go func() { + if err := api.AutoRefresh(context.Background()); err != nil { + panic(err) + } + }() go func() { http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { @@ -71,7 +75,6 @@ func main() { lastTick := time.Now() for now := range ticker.C { CurrentTraffic = CalculateSiteTraffic(api, sites, now.Sub(lastTick)) - fmt.Println(CurrentTraffic) lastTick = now } }