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;
}
let Ok(stats) = tokio::fs::metadata(entry.path()).await else {
warn!(
context,
"Cannot get metadata for {}.",
entry.path().display()
);
continue;
let stats = match tokio::fs::metadata(entry.path()).await {
Err(err) => {
warn!(
context,
"Cannot get metadata for {}: {:#}.",
entry.path().display(),
err
);
continue;
}
Ok(stats) => stats,
};
if stats.is_dir() {