add yomitan.db cleanup (which doesn't help)

This commit is contained in:
polv committed 2026-02-28 08:48:33 +07:00
1 parent bd281a3b2e
commit 641f23538b
4 files changed
+19 -3

No files matched your search

+5
View File
@@ -73,6 +73,11 @@ impl YomitanWriter {
Ok(Self { conn })
}
pub fn cleanup(&self) -> Result<()> {
self.conn.execute_batch("VACUUM")?;
Ok(())
}
pub fn create_schema(&mut self) -> Result<()> {
self.conn.execute_batch(
"
+8 -1
View File
@@ -51,6 +51,13 @@ impl AppService {
Ok(writer)
}
pub fn cleanup_yomitan_writer(&self) -> Result<YomitanWriter, CJDicError> {
let conn = Connection::open(self.db.dir.join(YOMITAN_DBFILE))?;
let writer = YomitanWriter::new(conn)?;
writer.cleanup()?;
Ok(writer)
}
pub fn load_yomitan_zip_dir<Z, LoadCallback, ImportCallback>(
&self,
zip_dir: Vec<Z>,
@@ -145,7 +152,7 @@ impl AppService {
}
pub fn import_yomitan_zip_file<Z, Callback>(
writer: &mut YomitanWriter,
writer: &mut YomitanWriter, // Reuse existing connection
zip_file: &Z,
lang: &str,
progress_callback: Callback,