Reset back to 0

This commit is contained in:
Ben Adrian Sarmiento
2024-06-27 16:03:15 +02:00
parent 7a7a79e882
commit 5e06f04f33

View File

@@ -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(`