mirror of
https://github.com/catdevnull/preciazo.git
synced 2024-11-22 14:16:19 +00:00
no reintentar junto a parse si es 404
This commit is contained in:
parent
b807de8eb4
commit
c66c325a4f
1 changed files with 7 additions and 1 deletions
|
@ -238,7 +238,13 @@ async fn fetch_and_parse(
|
||||||
}
|
}
|
||||||
|
|
||||||
get_parse_retry_policy()
|
get_parse_retry_policy()
|
||||||
.retry(|| fetch_and_scrap(client, url.clone()))
|
.retry_if(
|
||||||
|
|| fetch_and_scrap(client, url.clone()),
|
||||||
|
|err: &anyhow::Error| match err.downcast_ref::<reqwest::Error>() {
|
||||||
|
Some(e) => !e.status().is_some_and(|s| s == StatusCode::NOT_FOUND),
|
||||||
|
None => true,
|
||||||
|
},
|
||||||
|
)
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue