Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Kosuke Morimoto <[email protected]>
  • Loading branch information
kmrmt committed Sep 6, 2024
1 parent b1c53f4 commit e948201
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions internal/backoff/backoff.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,24 +185,24 @@ func (b *backoff) Do(
} else {
dur *= b.backoffFactor
jdur = b.addJitter(dur)
select {
case <-dctx.Done():
switch dctx.Err() {
case context.DeadlineExceeded:
log.Debugf("[backoff]\tfor: "+name+",\tDeadline Exceeded\terror: %v", err.Error())
return nil, errors.ErrBackoffTimeout(err)
case context.Canceled:
log.Debugf("[backoff]\tfor: "+name+",\tCanceled\terror: %v", err.Error())
return nil, err
default:
return nil, errors.Join(dctx.Err(), err)
}
default:
}
}
}
}
}
select {
case <-dctx.Done():
switch dctx.Err() {
case context.DeadlineExceeded:
log.Debugf("[backoff]\tfor: "+name+",\tDeadline Exceeded\terror: %v", err.Error())
return nil, errors.ErrBackoffTimeout(err)

Check warning on line 197 in internal/backoff/backoff.go

View check run for this annotation

Codecov / codecov/patch

internal/backoff/backoff.go#L195-L197

Added lines #L195 - L197 were not covered by tests
case context.Canceled:
log.Debugf("[backoff]\tfor: "+name+",\tCanceled\terror: %v", err.Error())
return nil, err
default:
return nil, errors.Join(dctx.Err(), err)

Check warning on line 202 in internal/backoff/backoff.go

View check run for this annotation

Codecov / codecov/patch

internal/backoff/backoff.go#L201-L202

Added lines #L201 - L202 were not covered by tests
}
default:
}
return res, err
}

Expand Down

0 comments on commit e948201

Please sign in to comment.