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