remove debug logs and panic if auto refresh failed
This commit is contained in:
parent
1fd0ecc167
commit
8bf2e7b687
7
main.go
7
main.go
@ -50,7 +50,11 @@ func main() {
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
go api.AutoRefresh(context.Background())
|
go func() {
|
||||||
|
if err := api.AutoRefresh(context.Background()); err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||||
@ -71,7 +75,6 @@ func main() {
|
|||||||
lastTick := time.Now()
|
lastTick := time.Now()
|
||||||
for now := range ticker.C {
|
for now := range ticker.C {
|
||||||
CurrentTraffic = CalculateSiteTraffic(api, sites, now.Sub(lastTick))
|
CurrentTraffic = CalculateSiteTraffic(api, sites, now.Sub(lastTick))
|
||||||
fmt.Println(CurrentTraffic)
|
|
||||||
lastTick = now
|
lastTick = now
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user