Skip to content

Commit

Permalink
Merge branch 'main' into feature/agent/rust/handle-rich-error-model
Browse files Browse the repository at this point in the history
  • Loading branch information
vankichi authored Sep 12, 2024
2 parents df1dd55 + 0e12419 commit 06c7a5d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions internal/backoff/backoff.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,22 @@ func (b *backoff) Do(
dur *= b.backoffFactor
jdur = b.addJitter(dur)
}
if cnt >= b.maxRetryCount-1 {
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:
}
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion versions/GO_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.23.0
1.23.1

0 comments on commit 06c7a5d

Please sign in to comment.