mirror of
https://github.com/OMGeeky/exponential_backoff.git
synced 2026-02-13 21:18:08 +01:00
increase try counter at the beginning to avoid getting stuck
This commit is contained in:
@@ -74,6 +74,7 @@ pub async fn check_backoff_twitch_with_client(
|
|||||||
trace!("check_backoff_twitch_with_client {:?}", request);
|
trace!("check_backoff_twitch_with_client {:?}", request);
|
||||||
let mut counter = 0;
|
let mut counter = 0;
|
||||||
loop {
|
loop {
|
||||||
|
counter += 1;
|
||||||
trace!("check_backoff_twitch_with_client loop ({})", counter);
|
trace!("check_backoff_twitch_with_client loop ({})", counter);
|
||||||
let r: Request = request
|
let r: Request = request
|
||||||
.try_clone()
|
.try_clone()
|
||||||
@@ -106,6 +107,7 @@ pub async fn check_backoff_twitch_with_client(
|
|||||||
.ok_or(BackoffError::new("No rate limit reset given"))?;
|
.ok_or(BackoffError::new("No rate limit reset given"))?;
|
||||||
let value: String = x.to_str()?.to_string();
|
let value: String = x.to_str()?.to_string();
|
||||||
handle_e429(value).await?;
|
handle_e429(value).await?;
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
_ => {
|
_ => {
|
||||||
@@ -114,8 +116,6 @@ pub async fn check_backoff_twitch_with_client(
|
|||||||
return Ok(response);
|
return Ok(response);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
counter += 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user