Hi! We are using the Geyser-Plugin-Runner to download and parse CAR files. Now we want to read from http urls directly as in the open_reader function. However, as the CAR file is very large, the connection may lost. Are there retry mechanisms that can be used to retry or continue from previous lost connections?
pub fn open_reader(path: &str) -> Result<Box<dyn Read + Send>, Box<dyn Error>> {
if path.starts_with("http://") || path.starts_with("https://") {
info!("Opening HTTP URL: {}", path);
let response = reqwest::blocking::get(path)?;
if !response.status().is_success() {
return Err(format!("HTTP error: {}", response.status()).into());
}
Ok(Box::new(response))
} else {
info!("Opening local file: {}", path);
let file = std::fs::File::open(path)?;
Ok(Box::new(file))
}
}