Skip to content

Commit 44f72e7

Browse files
committed
fix: log tokio::fs::metadata errors
1 parent 08be98f commit 44f72e7

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/sql.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -914,13 +914,17 @@ pub async fn remove_unused_files(context: &Context) -> Result<()> {
914914
continue;
915915
}
916916

917-
let Ok(stats) = tokio::fs::metadata(entry.path()).await else {
918-
warn!(
919-
context,
920-
"Cannot get metadata for {}.",
921-
entry.path().display()
922-
);
923-
continue;
917+
let stats = match tokio::fs::metadata(entry.path()).await {
918+
Err(err) => {
919+
warn!(
920+
context,
921+
"Cannot get metadata for {}: {:#}.",
922+
entry.path().display(),
923+
err
924+
);
925+
continue;
926+
}
927+
Ok(stats) => stats,
924928
};
925929

926930
if stats.is_dir() {

0 commit comments

Comments
 (0)