Db saving cases
This commit is contained in:
1 parent
294f0e8b98
commit
3663765284
4 files changed
+23
-3
No files matched your search
@@ -116,9 +116,10 @@ impl SqliteConnection {
|
||||
error!("Ошибка при checkpoint WAL: {e}");
|
||||
});
|
||||
connection
|
||||
.query_row("PRAGMA optimize", [], |_| Ok(()))
|
||||
.execute("PRAGMA optimize", [])
|
||||
.unwrap_or_else(|e| {
|
||||
error!("Ошибка при оптимизации БД: {e}");
|
||||
0
|
||||
});
|
||||
|
||||
self.0 = None;
|
||||
@@ -127,3 +128,8 @@ impl SqliteConnection {
|
||||
self.0 = Some(default_connection());
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for SqliteConnection {
|
||||
|
||||
fn drop(&mut self) { self.finish(); }
|
||||
}
|
||||
Reference in new issue
Block a user