Skip to content

Commit

Permalink
Reduce retries time (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaoticTempest authored Mar 11, 2022
1 parent dcf591d commit 6495b83
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions workspaces/src/rpc/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,9 @@ where
F: FnMut() -> T,
T: core::future::Future<Output = Result<R, E>>,
{
// Exponential backoff starting w/ 10ms for maximum retry of 5 times:
let retry_strategy = ExponentialBackoff::from_millis(10).map(jitter).take(5);
// Exponential backoff starting w/ 5ms for maximum retry of 4 times with the following delays:
// 5, 25, 125, 625 ms
let retry_strategy = ExponentialBackoff::from_millis(5).map(jitter).take(4);

Retry::spawn(retry_strategy, task).await
}
Expand Down

0 comments on commit 6495b83

Please sign in to comment.