crates/common: enhance notifications and GC roots handling
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I8a19eeda480672f8f22adbafb3039db66a6a6964
This commit is contained in:
parent
2378ff6661
commit
a52c61556a
2 changed files with 6 additions and 9 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue