diff --git a/cmd/auto-pause/auto-pause.go b/cmd/auto-pause/auto-pause.go index 64da9df941ec..cc533789df04 100644 --- a/cmd/auto-pause/auto-pause.go +++ b/cmd/auto-pause/auto-pause.go @@ -64,6 +64,15 @@ func main() { fmt.Printf("Got request\n") if runtimePaused { runUnpause() + idleTimeout.Reset(interval) + // Drain the timeout channel in case of racing condition. + for { + select { + case <-idleTimeout.C: + default: + break + } + } } done <- struct{}{}