fix: try safebooru fix again

This commit is contained in:
dusk 2024-06-11 17:08:03 +03:00
parent a8ea85f971
commit 9dd862367a
Signed by: dusk
SSH Key Fingerprint: SHA256:Abmvag+juovVufZTxyWY8KcVgrznxvBjQpJesv071Aw

View File

@ -126,7 +126,7 @@ async fn fetch_safebooru_image_link(http: &reqwest::Client, url: &Uri) -> AppRes
let url = url.clone(); let url = url.clone();
let http = http.clone(); let http = http.clone();
async move { async move {
println!("[safebooru] trying to fetch url (count 0): {url}"); println!("[safebooru] trying to fetch url: {url}");
let req = http.get(url).build()?; let req = http.get(url).build()?;
let resp = http.execute(req).await?.error_for_status()?; let resp = http.execute(req).await?.error_for_status()?;
let data = resp.json::<Data>().await?; let data = resp.json::<Data>().await?;
@ -140,9 +140,8 @@ async fn fetch_safebooru_image_link(http: &reqwest::Client, url: &Uri) -> AppRes
futures_retry::RetryPolicy::<error::AppError>::ForwardError(e) futures_retry::RetryPolicy::<error::AppError>::ForwardError(e)
} else { } else {
attempts += 1; attempts += 1;
futures_retry::RetryPolicy::<error::AppError>::WaitRetry( println!("[safebooru] retrying url fetch (attempt {attempts}): {url}");
std::time::Duration::from_secs(1), futures_retry::RetryPolicy::<error::AppError>::Repeat
)
} }
}) })
.await .await