Prevent 2-second sleep every query

This commit is contained in:
Kiana Sheibani 2023-10-02 20:39:32 -04:00
parent 07f95ddd17
commit 6afcd444a7
Signed by: toki
GPG key ID: 6CB106C25E86A9F7

View file

@ -90,14 +90,14 @@ where
.run_graphql(Builder::build(vars)); .run_graphql(Builder::build(vars));
for _ in 1..10 { for _ in 1..10 {
if response.is_ok() {
break;
}
sleep(Duration::from_secs(2)); sleep(Duration::from_secs(2));
response = reqwest::blocking::Client::new() response = reqwest::blocking::Client::new()
.post("https://api.start.gg/gql/alpha") .post("https://api.start.gg/gql/alpha")
.header("Authorization", String::from("Bearer ") + auth_token) .header("Authorization", String::from("Bearer ") + auth_token)
.run_graphql(Builder::build(vars)); .run_graphql(Builder::build(vars));
if response.is_ok() {
break;
}
} }
Builder::unwrap_response(response.ok()?) Builder::unwrap_response(response.ok()?)