mirror of
https://github.com/netbirdio/netbird.git
synced 2025-03-13 06:08:48 +01:00
Always stop timer
This commit is contained in:
parent
bfa6df13c5
commit
6a0f6efc18
@ -57,9 +57,10 @@ func (e *endpointUpdater) removeWgPeer() error {
|
||||
// scheduleDelayedUpdate waits for the fallback period before updating the endpoint
|
||||
func (e *endpointUpdater) scheduleDelayedUpdate(ctx context.Context, addr *net.UDPAddr) {
|
||||
t := time.NewTimer(fallbackDelay)
|
||||
defer t.Stop()
|
||||
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
t.Stop()
|
||||
return
|
||||
case <-t.C:
|
||||
e.configUpdateMutex.Lock()
|
||||
|
Loading…
Reference in New Issue
Block a user