upgrade deps
All checks were successful
CI/CD Pipeline / test (push) Successful in 2m53s
Update CI/CD Pipeline / update (push) Successful in 16m51s

This commit is contained in:
2025-03-29 11:37:25 +01:00
parent dea7a2b3a1
commit 9f7dc72a1b
4 changed files with 56 additions and 286 deletions

View File

@ -136,18 +136,23 @@ fn delete_all_in_dir<P: AsRef<Path>>(dir_path: P) -> std::io::Result<()> {
pub(crate) fn fetch_with_retries(url: &str) -> Result<String, Error> {
let mut attempts = 0;
let max_attempts = 100;
let max_attempts = 20;
loop {
match ureq::get(url).call() {
Ok(response) => {
Ok(mut response) => {
// If the request is successful, return the response body
match response.into_string() {
match response.body_mut().read_to_string() {
Ok(d) => return Ok(d),
Err(e) => return Err(e.into()),
}
}
Err(ureq::Error::Transport(_)) => {
Err(ureq::Error::Protocol(_))
| Err(ureq::Error::Io(_))
| Err(ureq::Error::HostNotFound)
| Err(ureq::Error::RedirectFailed)
| Err(ureq::Error::ConnectionFailed)
| Err(ureq::Error::Timeout(_)) => {
// Increment the attempt counter
attempts += 1;

View File

@ -163,8 +163,9 @@ fn fetch_page(typ: &Typ, overview_id: usize, fassung: &str, page: usize) -> Resu
}
let data = ureq::post(&format!("https://data.bka.gv.at/ris/api/v2.6/{path}"))
.send_form(&form_params)?
.into_string()?;
.send_form(form_params)?
.body_mut()
.read_to_string()?;
let path = Path::new(&expected_filename);
if let Some(parent) = path.parent() {