fix missed reporting on path cleanups

feat/vaults
Tomáš Mládek 2022-01-08 12:21:04 +01:00
parent 368eb90d5b
commit 952475b92b
No known key found for this signature in database
GPG Key ID: ED21612889E75EC5
1 changed files with 11 additions and 5 deletions

View File

@ -181,12 +181,21 @@ fn _rescan_vault<D: Borrow<UpEndDatabase>>(
}
});
// Re-enable SQLite syncing
drop(_guard);
// Reporting
let all_outcomes = path_outcomes
.into_iter()
.chain(cleanup_results)
.collect::<Vec<UpdatePathOutcome>>();
let mut failed: Vec<(&PathBuf, &Error)> = vec![];
let mut created = 0;
let mut unchanged = 0;
let mut deleted = 0;
for outcome in &path_outcomes {
for outcome in &all_outcomes {
match outcome {
UpdatePathOutcome::Added(_) => created += 1,
UpdatePathOutcome::Unchanged(_) => unchanged += 1,
@ -207,9 +216,6 @@ fn _rescan_vault<D: Borrow<UpEndDatabase>>(
)
}
// Re-enable SQLite syncing
drop(_guard);
info!(
"Finished updating {:?} ({} created, {} deleted, {} left unchanged). Took {}s.",
db.vault_path,
@ -219,7 +225,7 @@ fn _rescan_vault<D: Borrow<UpEndDatabase>>(
start.elapsed().as_secs()
);
Ok(path_outcomes.into_iter().chain(cleanup_results).collect())
Ok(all_outcomes)
}
fn _process_directory_entry<P: AsRef<Path>>(