fix: log tokio::fs::metadata errors

This commit is contained in:
link2xt
2025-02-26 19:21:50 +00:00
committed by l
parent 08be98f693
commit 44f72e7f85

View File

@@ -914,13 +914,17 @@ pub async fn remove_unused_files(context: &Context) -> Result<()> {
continue; continue;
} }
let Ok(stats) = tokio::fs::metadata(entry.path()).await else { let stats = match tokio::fs::metadata(entry.path()).await {
Err(err) => {
warn!( warn!(
context, context,
"Cannot get metadata for {}.", "Cannot get metadata for {}: {:#}.",
entry.path().display() entry.path().display(),
err
); );
continue; continue;
}
Ok(stats) => stats,
}; };
if stats.is_dir() { if stats.is_dir() {