From 5e06f04f33bb124a67781f3c4d6b1a376f326867 Mon Sep 17 00:00:00 2001 From: Ben Adrian Sarmiento Date: Thu, 27 Jun 2024 16:03:15 +0200 Subject: [PATCH] Reset back to 0 --- internal/handlers/home.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/handlers/home.go b/internal/handlers/home.go index 433aaa0..b18daa3 100644 --- a/internal/handlers/home.go +++ b/internal/handlers/home.go @@ -199,7 +199,9 @@ func (zr *Handlers) handleHome(resp http.ResponseWriter, req *http.Request) { efficiency := response.ServedMB * 100 / denominator if zr.initialTraffic.Load() > response.TrafficLogged { - zr.initialTraffic.Store(response.TrafficLogged) + // it cannot be bigger than traffic logged + // so it must be a reset back to 0 + zr.initialTraffic.Store(0) } out += fmt.Sprintf(`