From 706558530bb79258b717d5e72c01986e5c6ff4b2 Mon Sep 17 00:00:00 2001 From: OMGeeky Date: Thu, 1 Jun 2023 22:29:14 +0200 Subject: [PATCH] increase try counter at the beginning to avoid getting stuck --- src/twitch.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/twitch.rs b/src/twitch.rs index acd141c..b78b4d9 100644 --- a/src/twitch.rs +++ b/src/twitch.rs @@ -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; } }