diff --git a/context.go b/context.go index df3a119..7706faa 100644 --- a/context.go +++ b/context.go @@ -56,7 +56,7 @@ func (b *backOffContext) NextBackOff() time.Duration { default: } next := b.BackOff.NextBackOff() - if deadline, ok := b.ctx.Deadline(); ok && time.Until(deadline) < next { + if deadline, ok := b.ctx.Deadline(); ok && deadline.Sub(time.Now()) < next { return Stop } return next