fix: Actually do the exponential part of exponential backoff

pull/24376/head
Carol (Nichols || Goulding) 2021-09-24 16:57:45 -04:00
parent d69472e114
commit 9cdccae49d
1 changed files with 2 additions and 3 deletions

View File

@ -477,9 +477,8 @@ where
H: Future<Output = Result<R, rusoto_core::RusotoError<E>>> + Send,
{
let mut attempts = 0;
// TODO: configurable
// TODO: make the number of retries configurable
let n_retries = 10;
// TODO: let backoff =
FutureRetry::new(
move || {
@ -504,7 +503,7 @@ where
if attempts > n_retries || !should_retry {
RetryPolicy::ForwardError(e)
} else {
RetryPolicy::WaitRetry(Duration::from_millis(200))
RetryPolicy::WaitRetry(Duration::from_millis(2u64.pow(attempts) * 50))
}
}
},