Browse Source

Fix #86 - set a 20s min threshold before re-polling

kegan/metrics
Kegan Dougal 8 years ago
parent
commit
248822a3d6
  1. 8
      src/github.com/matrix-org/go-neb/services/rssbot/rssbot.go

8
src/github.com/matrix-org/go-neb/services/rssbot/rssbot.go

@ -158,6 +158,14 @@ func (s *rssBotService) nextTimestamp() time.Time {
earliestNextTs = feedInfo.NextPollTimestampSecs
}
}
// Don't allow times in the past. Set a min re-poll threshold of 20s to avoid
// tight-looping on feeds which 500.
now := time.Now().Unix()
if earliestNextTs <= now {
earliestNextTs = now + 20
}
return time.Unix(earliestNextTs, 0)
}

Loading…
Cancel
Save