use retry mechanism for fetching data
Some checks failed
CI/CD Pipeline / test (push) Failing after 1m43s
Some checks failed
CI/CD Pipeline / test (push) Failing after 1m43s
This commit is contained in:
@ -29,7 +29,7 @@ use log::info;
|
||||
|
||||
use crate::{
|
||||
law::LawBuilder,
|
||||
misc::{get_cache_dir, Error},
|
||||
misc::{fetch_with_retries, get_cache_dir, Error},
|
||||
};
|
||||
|
||||
use self::parser::Risdok;
|
||||
@ -138,7 +138,7 @@ fn fetch(url: &str) -> Result<String, Error> {
|
||||
Ok(data) => Ok(data),
|
||||
Err(_) => {
|
||||
info!("Not finding url {url} in the cache, downloading...");
|
||||
let data = ureq::get(url).call()?.into_string()?;
|
||||
let data = fetch_with_retries(url)?;
|
||||
let path = Path::new(&expected_filename);
|
||||
if let Some(parent) = path.parent() {
|
||||
// Try to create the directory (and any necessary parent directories)
|
||||
|
Reference in New Issue
Block a user