mirror of
https://github.com/NLnetLabs/krill.git
synced 2026-09-24 02:14:54 +02:00
Write notification.xml to new file, then rename #352
This commit is contained in:
@@ -311,8 +311,10 @@ impl RrdpServer {
|
||||
}
|
||||
|
||||
// something changed, update notification file
|
||||
let notification_path_new = self.notification_path_new();
|
||||
let notification_path = self.notification_path();
|
||||
self.notification.write_xml(¬ification_path)?;
|
||||
self.notification.write_xml(¬ification_path_new)?;
|
||||
fs::rename(notification_path_new, notification_path)?;
|
||||
|
||||
// clean up under the base dir:
|
||||
// - old session dirs
|
||||
@@ -401,6 +403,12 @@ impl RrdpServer {
|
||||
// Cannot fail. Config checked at startup.
|
||||
}
|
||||
|
||||
fn notification_path_new(&self) -> PathBuf {
|
||||
let mut path = self.rrdp_base_dir.clone();
|
||||
path.push("new-notification.xml");
|
||||
path
|
||||
}
|
||||
|
||||
fn notification_path(&self) -> PathBuf {
|
||||
let mut path = self.rrdp_base_dir.clone();
|
||||
path.push("notification.xml");
|
||||
|
||||
Reference in New Issue
Block a user