ryankert01 commented on code in PR #4104:
URL: https://github.com/apache/iggy/pull/4104#discussion_r3975952624
##########
core/connectors/sdk/src/retry.rs:
##########
@@ -256,34 +376,28 @@ impl Middleware for HttpRetryMiddleware {
return Ok(response);
}
- // Parse Retry-After header on 429 before falling back to
- // our own calculated backoff.
+ // Parse Retry-After on 429 before falling back to our own
+ // calculated backoff.
let retry_after = if status ==
reqwest::StatusCode::TOO_MANY_REQUESTS {
response
.headers()
.get("Retry-After")
- .and_then(|v| v.to_str().ok())
+ .and_then(|value| value.to_str().ok())
.and_then(parse_retry_after)
} else {
None
};
attempts += 1;
- if is_transient_status(status) && attempts <
self.max_retries {
+ if is_transient_status(status) && attempts <
self.policy.max_attempts {
// Consume the error body for logging, then retry.
let body_text =
response.text().await.unwrap_or_default();
- let delay = retry_after.unwrap_or_else(|| {
- jitter(exponential_backoff(
- self.retry_delay,
- attempts,
- self.max_delay,
- ))
- });
+ let delay = retry_after.unwrap_or_else(||
self.policy.backoff(attempts));
Review Comment:
Done,
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]