From 6afcd444a7c125b925969e661345b1f6b57a720b Mon Sep 17 00:00:00 2001 From: Kiana Sheibani Date: Mon, 2 Oct 2023 20:39:32 -0400 Subject: [PATCH] Prevent 2-second sleep every query --- src/queries.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/queries.rs b/src/queries.rs index cfbcf47..c1ee2d7 100644 --- a/src/queries.rs +++ b/src/queries.rs @@ -90,14 +90,14 @@ where .run_graphql(Builder::build(vars)); for _ in 1..10 { + if response.is_ok() { + break; + } sleep(Duration::from_secs(2)); response = reqwest::blocking::Client::new() .post("https://api.start.gg/gql/alpha") .header("Authorization", String::from("Bearer ") + auth_token) .run_graphql(Builder::build(vars)); - if response.is_ok() { - break; - } } Builder::unwrap_response(response.ok()?)