crates/common: enhance notifications and GC roots handling

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I8a19eeda480672f8f22adbafb3039db66a6a6964
This commit is contained in:
raf 2026-02-02 01:24:15 +03:00
commit a52c61556a
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
2 changed files with 6 additions and 9 deletions

View file

@ -27,8 +27,8 @@ pub fn cleanup_old_roots(roots_dir: &Path, max_age: Duration) -> std::io::Result
Err(_) => continue,
};
if let Ok(age) = now.duration_since(modified) {
if age > max_age {
if let Ok(age) = now.duration_since(modified)
&& age > max_age {
if let Err(e) = std::fs::remove_file(entry.path()) {
warn!(
"Failed to remove old GC root {}: {e}",
@ -38,7 +38,6 @@ pub fn cleanup_old_roots(roots_dir: &Path, max_age: Duration) -> std::io::Result
count += 1;
}
}
}
}
Ok(count)