mirror of
https://github.com/chatmail/core.git
synced 2026-05-03 21:36:29 +03:00
also move WAL file when moving database (#2583)
the WAL files come from sqlite WAL mode, they have the same name as the database file with an extra `-wal` suffix. according to https://sqlite.org/wal.html#the_wal_file , the WAL file is part of the persistent state of the database and should be kept with the database if the database is copied or moved.
This commit is contained in:
@@ -559,6 +559,13 @@ impl Context {
|
||||
blob_fname.push("-blobs");
|
||||
dbfile.with_file_name(blob_fname)
|
||||
}
|
||||
|
||||
pub fn derive_walfile(dbfile: &PathBuf) -> PathBuf {
|
||||
let mut wal_fname = OsString::new();
|
||||
wal_fname.push(dbfile.file_name().unwrap_or_default());
|
||||
wal_fname.push("-wal");
|
||||
dbfile.with_file_name(wal_fname)
|
||||
}
|
||||
}
|
||||
|
||||
impl InnerContext {
|
||||
|
||||
Reference in New Issue
Block a user