mirror of
https://github.com/OMGeeky/exponential_backoff.git
synced 2025-12-27 06:29:35 +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);
|
||||
let mut counter = 0;
|
||||
loop {
|
||||
counter += 1;
|
||||
trace!("check_backoff_twitch_with_client loop ({})", counter);
|
||||
let r: Request = request
|
||||
.try_clone()
|
||||
@@ -106,6 +107,7 @@ pub async fn check_backoff_twitch_with_client(
|
||||
.ok_or(BackoffError::new("No rate limit reset given"))?;
|
||||
let value: String = x.to_str()?.to_string();
|
||||
handle_e429(value).await?;
|
||||
continue;
|
||||
}
|
||||
|
||||
_ => {
|
||||
@@ -114,8 +116,6 @@ pub async fn check_backoff_twitch_with_client(
|
||||
return Ok(response);
|
||||
}
|
||||
}
|
||||
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user