Handle better sleep period

This commit is contained in:
Zoltan Papp
2025-10-14 12:24:39 +02:00
parent bfa776c155
commit 158f3aceff

View File

@@ -143,8 +143,13 @@ func wakeUpListen(ctx context.Context) {
initialHash, err = readSleepTimeHash()
if err != nil {
log.Errorf("failed to detect initial sleep time: %v", err)
time.Sleep(3 * time.Second)
continue
select {
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)
break