Skip to content

Commit

Permalink
ceb: increase staleness range
Browse files Browse the repository at this point in the history
  • Loading branch information
hg committed Jun 7, 2021
1 parent 0e17d1d commit da7bf64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gateway/ceb/ceb.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit da7bf64

Please sign in to comment.