turn off synchronous mode during fs resyncs
parent
99c4a4e488
commit
4b1a8c862c
|
@ -97,6 +97,9 @@ fn _rescan_vault<T: AsRef<Path>>(
|
||||||
// Initialize types, etc...
|
// Initialize types, etc...
|
||||||
initialize_types(&pool)?;
|
initialize_types(&pool)?;
|
||||||
|
|
||||||
|
// Disable syncing in SQLite for the duration of the import
|
||||||
|
pool.get()?.execute("PRAGMA synchronous = OFF;")?;
|
||||||
|
|
||||||
// Walk through the vault, find all paths
|
// Walk through the vault, find all paths
|
||||||
let path_entries: Vec<PathBuf> = WalkDir::new(&directory)
|
let path_entries: Vec<PathBuf> = WalkDir::new(&directory)
|
||||||
.follow_links(true)
|
.follow_links(true)
|
||||||
|
@ -178,6 +181,9 @@ fn _rescan_vault<T: AsRef<Path>>(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Re-enable SQLite syncing
|
||||||
|
pool.get()?.execute("PRAGMA synchronous = NORMAL;")?;
|
||||||
|
|
||||||
info!(
|
info!(
|
||||||
"Finished updating {} ({} created, {} deleted, {} left unchanged). Took {}s.",
|
"Finished updating {} ({} created, {} deleted, {} left unchanged). Took {}s.",
|
||||||
directory.as_ref().display(),
|
directory.as_ref().display(),
|
||||||
|
|
Loading…
Reference in New Issue