Skip to content

Commit

Permalink
Improve retries logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
Edu4rdSHL committed Oct 23, 2023
1 parent bc9e404 commit b0876d0
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/httplib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ pub async fn return_http_data(options: &LibOptions) -> HashMap<String, HttpData>

async move {
if options.retries > 1 {
let mut counter = 0;
while counter < options.retries {
for _ in 0..options.retries {
if let Some(resp) = https_send_fut.try_clone() {
if let Ok(resp) = resp.send().await {
response = Some(resp);
Expand All @@ -59,7 +58,6 @@ pub async fn return_http_data(options: &LibOptions) -> HashMap<String, HttpData>
response = Some(resp);
break;
}
counter += 1;
}
}
} else if let Ok(resp) = https_send_fut.send().await {
Expand Down

0 comments on commit b0876d0

Please sign in to comment.