chore: allow heartbeats from one hour into the future to compensate for clock inaccuracies (see #342)

This commit is contained in:
Ferdinand Mütsch 2022-03-19 09:02:15 +01:00
parent 4cea50b5c8
commit eae45baf38
1 changed files with 1 additions and 1 deletions

View File

@ -36,7 +36,7 @@ func (h *Heartbeat) Valid() bool {
func (h *Heartbeat) Timely(maxAge time.Duration) bool {
now := time.Now()
return now.Sub(h.Time.T()) <= maxAge && h.Time.T().Before(now)
return now.Sub(h.Time.T()) <= maxAge && h.Time.T().Sub(now) < 1*time.Hour
}
func (h *Heartbeat) Augment(languageMappings map[string]string) {