Skip to content

Commit 2477ab4

Browse files
committed
wait with an exponential backoff capped at 1 minute
1 parent e4c72ed commit 2477ab4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ macro_rules! impl_inner_call {
6363
// previous loop when trying to read()
6464
if let Ok(mut write_client) = $self.client_type.try_write() {
6565
loop {
66-
std::thread::sleep(std::time::Duration::from_secs(errors.len() as u64));
66+
std::thread::sleep(std::time::Duration::from_secs((1 << errors.len()).min(30) as u64));
6767
match ClientType::from_config(&$self.url, &$self.config) {
6868
Ok(new_client) => {
6969
info!("Succesfully created new client");

0 commit comments

Comments
 (0)