From da7bf6405c9f74a92752f86fd11b33ca2d3adf67 Mon Sep 17 00:00:00 2001 From: Kirill Isakov Date: Tue, 8 Jun 2021 00:02:44 +0600 Subject: [PATCH] ceb: increase staleness range --- gateway/ceb/ceb.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gateway/ceb/ceb.go b/gateway/ceb/ceb.go index 4df42c5..d0a4a69 100644 --- a/gateway/ceb/ceb.go +++ b/gateway/ceb/ceb.go @@ -28,7 +28,7 @@ type measurement struct { const dataUrl = "https://ceb-uk.kz/map/ajax.php?markers" const timeFilename = "ceb-times.json" -const staleMaxUpdates = 3 +const staleMaxUpdates = 5 type repeat struct { level float64 @@ -59,10 +59,10 @@ func (s *staleDetector) isStale(station string, pollutant string, level float64) } if rep.level == level { - rep.count++ if rep.count >= staleMaxUpdates { return true } + rep.count++ } else { rep.level = level rep.count = 0