diff --git a/src/filesystem.rs b/src/filesystem.rs index 443a30d..089f56c 100644 --- a/src/filesystem.rs +++ b/src/filesystem.rs @@ -181,12 +181,21 @@ fn _rescan_vault>( } }); + // Re-enable SQLite syncing + drop(_guard); + + // Reporting + let all_outcomes = path_outcomes + .into_iter() + .chain(cleanup_results) + .collect::>(); + 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>( ) } - // 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>( start.elapsed().as_secs() ); - Ok(path_outcomes.into_iter().chain(cleanup_results).collect()) + Ok(all_outcomes) } fn _process_directory_entry>(