diff --git a/component/slowdown/slowdown.go b/component/slowdown/slowdown.go index 3fc12191a..eff4915f1 100644 --- a/component/slowdown/slowdown.go +++ b/component/slowdown/slowdown.go @@ -12,8 +12,10 @@ type SlowDown struct { } func (s *SlowDown) Wait(ctx context.Context) (err error) { + timer := time.NewTimer(s.backoff.Duration()) + defer timer.Stop() select { - case <-time.After(s.backoff.Duration()): + case <-timer.C: case <-ctx.Done(): err = ctx.Err() }