mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-12 19:55:14 +02:00
Add vacuum method to Indexer for database maintenance
- Added a `vacuum` method in `database.rs` to optimize database file size and performance. - Integrated `vacuum` calls into `scan.rs` and `index.rs` to ensure regular maintenance during operations.
This commit is contained in:
parent
0a62b6f40c
commit
eedfc5dbe8
3 changed files with 17 additions and 1 deletions
|
|
@ -211,10 +211,15 @@ pub mod index {
|
|||
VACUUM;
|
||||
"#,
|
||||
)?;
|
||||
|
||||
|
||||
self.c().execute_batch(SCHEMA)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn vacuum(&self) -> rusqlite::Result<()> {
|
||||
self.c().execute("VACUUM;", [])?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn digest_file(path: &Path) -> Result<Vec<u8>, Box<dyn std::error::Error>> {
|
||||
let mut hasher = blake3::Hasher::new();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue