mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
chore: allow heartbeats from one hour into the future to compensate for clock inaccuracies (see #342)
This commit is contained in:
parent
4cea50b5c8
commit
eae45baf38
@ -36,7 +36,7 @@ func (h *Heartbeat) Valid() bool {
|
|||||||
|
|
||||||
func (h *Heartbeat) Timely(maxAge time.Duration) bool {
|
func (h *Heartbeat) Timely(maxAge time.Duration) bool {
|
||||||
now := time.Now()
|
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) {
|
func (h *Heartbeat) Augment(languageMappings map[string]string) {
|
||||||
|
Loading…
Reference in New Issue
Block a user