mirror of
https://github.com/edu4rdshl/fhc.git
synced 2026-07-17 23:24:50 +00:00
Improve retries logic.
This commit is contained in:
parent
bc9e4043d9
commit
b0876d0f16
1 changed files with 1 additions and 3 deletions
|
|
@ -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);
|
||||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue