Skip to content

Commit

Permalink
chore: retry 429 errors (#7384)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Mar 12, 2024
1 parent 4fa0fa1 commit 46889b1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crates/common/src/provider/retry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ fn should_retry_transport_level_error(error: &TransportErrorKind) -> bool {
match error {
// Missing batch response errors can be retried.
TransportErrorKind::MissingBatchResponse(_) => true,
TransportErrorKind::Custom(err) => {
// currently http error responses are not standard in alloy
let msg = err.to_string();
msg.contains("429 Too Many Requests")
}

// If the backend is gone, or there's a completely custom error, we should assume it's not
// retryable.
_ => false,
Expand Down

0 comments on commit 46889b1

Please sign in to comment.