Skip to content

Commit

Permalink
wait with an exponential backoff capped at 1 minute
Browse files Browse the repository at this point in the history
  • Loading branch information
RCasatta committed Nov 25, 2020
1 parent f0e863f commit 173addb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ macro_rules! impl_inner_call {
// previous loop when trying to read()
if let Ok(mut write_client) = $self.client_type.try_write() {
loop {
std::thread::sleep(std::time::Duration::from_secs(errors.len() as u64));
std::thread::sleep(std::time::Duration::from_secs((errors.len() * errors.len()).min(60) as u64));
match ClientType::from_config(&$self.url, &$self.config) {
Ok(new_client) => {
info!("Succesfully created new client");
Expand Down

0 comments on commit 173addb

Please sign in to comment.