mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-23 22:09:09 +02:00
Handle better sleep period
This commit is contained in:
@@ -143,8 +143,13 @@ func wakeUpListen(ctx context.Context) {
|
|||||||
initialHash, err = readSleepTimeHash()
|
initialHash, err = readSleepTimeHash()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("failed to detect initial sleep time: %v", err)
|
log.Errorf("failed to detect initial sleep time: %v", err)
|
||||||
time.Sleep(3 * time.Second)
|
select {
|
||||||
continue
|
case <-ctx.Done():
|
||||||
|
log.Info("exit from wakeUpListen initial hash detection due to context cancellation")
|
||||||
|
return
|
||||||
|
case <-time.After(3 * time.Second):
|
||||||
|
continue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
log.Debugf("initial wakeup hash: %d", initialHash)
|
log.Debugf("initial wakeup hash: %d", initialHash)
|
||||||
break
|
break
|
||||||
|
|||||||
Reference in New Issue
Block a user