fix: for defer'ed deleteObject use internal context (#10463)

This commit is contained in:
Harshavardhana
2020-09-11 06:39:19 -07:00
committed by GitHub
parent eb3ded420e
commit 48919de301
4 changed files with 24 additions and 49 deletions

View File

@@ -99,10 +99,10 @@ func NewTimerWithJitter(ctx context.Context, unit time.Duration, cap time.Durati
// Channel used to signal after the expiry of backoff wait seconds.
for {
select {
case attemptCh <- nextBackoff:
nextBackoff++
case <-ctx.Done():
return
case attemptCh <- nextBackoff:
nextBackoff++
}
t.Start(exponentialBackoffWait(nextBackoff))