diff --git a/internal/common/sleep.go b/internal/common/sleep.go index 8c35b17..9bed241 100644 --- a/internal/common/sleep.go +++ b/internal/common/sleep.go @@ -11,6 +11,9 @@ func Sleep(ctx context.Context, interval time.Duration) error { timer := time.NewTimer(interval) select { case <-ctx.Done(): + if !timer.Stop() { + <-timer.C + } return ctx.Err() case <-timer.C: return nil