Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
cli: Gracefully handle failure to link log file
Lorenz Leutgeb committed 8 months ago
commit ed5b2659c8d67670627f95405cfa6bceab98904f
parent de78cf7874daceefbf6b370a31a3465e34e86423
1 file changed +11 -1
modified crates/radicle-cli/src/commands/node/logs.rs
@@ -153,11 +153,21 @@ impl Rotate {
                log::warn!(target: "cli", "Failed to remove current log file: {err}");
            }
        }
+

        let log = OpenOptions::new()
            .write(true)
            .create_new(true)
            .open(&self.next)?;
-
        fs::hard_link(&self.next, &self.link)?;
+

+
        if let Err(err) = fs::hard_link(&self.next, &self.link) {
+
            log::warn!(
+
                target: "cli",
+
                "Failed to create hard link from {} to {}: {err}",
+
                self.next.display(),
+
                self.link.display()
+
            );
+
        }
+

        Ok(Rotated {
            path: self.next,
            log,