mirror of
https://github.com/netbirdio/netbird.git
synced 2025-01-23 14:28:51 +01:00
Return 1s when next expiration is too low (#1672)
using the login expired issue could cause problems with ticker used in the scheduler This change makes 1s the minimum number returned when rescheduling the peer expiration task
This commit is contained in:
parent
6d747b2f83
commit
0aeb87742a
@ -455,6 +455,11 @@ func (a *Account) GetNextPeerExpiration() (time.Duration, bool) {
|
||||
}
|
||||
_, duration := peer.LoginExpired(a.Settings.PeerLoginExpiration)
|
||||
if nextExpiry == nil || duration < *nextExpiry {
|
||||
// if expiration is below 1s return 1s duration
|
||||
// this avoids issues with ticker that can't be set to < 0
|
||||
if duration < time.Second {
|
||||
return time.Second, true
|
||||
}
|
||||
nextExpiry = &duration
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user