1
0
mirror of https://github.com/NLnetLabs/routinator.git synced 2024-05-19 06:50:04 +00:00

Ignore unavailable rsync targets.

This commit is contained in:
Martin Hoffmann
2018-07-02 22:22:58 +02:00
parent 13d76ec150
commit cc87d891bf
2 changed files with 9 additions and 2 deletions

View File

@ -70,6 +70,7 @@ impl Repository {
}
fn update(&self) -> Result<bool, ProcessingError> {
debug!("UPDATED NOT IMPLEMENTED YET.");
Ok(false)
}
@ -310,9 +311,14 @@ impl Repository {
Ok(Some(data.into()))
}
Err(ref err) if err.kind() == io::ErrorKind::NotFound && create => {
self.populate_uri_dir(uri)?;
if let Err(_) = self.populate_uri_dir(uri) {
debug!("rsync failed. Skipping ...");
Ok(None)
}
else {
self.load_file(uri, false)
}
}
Err(err) => Err(err.into())
}
}

View File

@ -18,6 +18,7 @@ pub fn update<P: AsRef<Path>>(
let status = Command::new("rsync")
.arg("-az")
.arg("--delete")
.arg("--contimeout=10")
.arg(source.as_str())
.arg(destination.as_ref())
.status()?;