aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex <lx@deuxfleurs.fr>2025-01-27 18:50:11 +0000
committerAlex <lx@deuxfleurs.fr>2025-01-27 18:50:11 +0000
commitbeedc9fd11d24ccce837cc229ea6c30c980f9baa (patch)
tree15002ff00ac84a8bce67a63f71efc875f54caf26
parentd4e3e609209eb52d820338daf628df7cf09881ab (diff)
parent43402c9619152e2d670f3b33fd09e3d3abf340e7 (diff)
downloadgarage-beedc9fd11d24ccce837cc229ea6c30c980f9baa.tar.gz
garage-beedc9fd11d24ccce837cc229ea6c30c980f9baa.zip
Merge pull request 'snapshot: sqlite: use a subdirectory for consistency with LMDB' (#932) from baptiste/garage:snapshot_consistency_sqlite into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/932
-rw-r--r--src/db/sqlite_adapter.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/db/sqlite_adapter.rs b/src/db/sqlite_adapter.rs
index f3aa35d1..ce6412b6 100644
--- a/src/db/sqlite_adapter.rs
+++ b/src/db/sqlite_adapter.rs
@@ -144,9 +144,12 @@ impl IDb for SqliteDb {
let percent = (p.pagecount - p.remaining) * 100 / p.pagecount;
info!("Sqlite snapshot progress: {}%", percent);
}
+ std::fs::create_dir_all(to)?;
+ let mut path = to.clone();
+ path.push("db.sqlite");
self.db
.get()?
- .backup(rusqlite::DatabaseName::Main, to, Some(progress))?;
+ .backup(rusqlite::DatabaseName::Main, path, Some(progress))?;
Ok(())
}