diff options
author | Alex Auvolat <alex@adnab.me> | 2023-05-17 14:30:53 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2023-05-17 14:30:53 +0200 |
commit | 19639705e6242861bd43a123456793e2d8f2c69a (patch) | |
tree | 17710b95f770cdde8e6405479f8262a12bcf6a13 /src/model/garage.rs | |
parent | 351d734e6c035a6f22f9fe0d62a783a81a134f45 (diff) | |
download | garage-19639705e6242861bd43a123456793e2d8f2c69a.tar.gz garage-19639705e6242861bd43a123456793e2d8f2c69a.zip |
Mark sled as deprecated, make lmdb default, and improve sqlite and lmdb defaults
Diffstat (limited to 'src/model/garage.rs')
-rw-r--r-- | src/model/garage.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/model/garage.rs b/src/model/garage.rs index 3daa1b33..0fbcf334 100644 --- a/src/model/garage.rs +++ b/src/model/garage.rs @@ -109,6 +109,11 @@ impl Garage { db_path.push("db.sqlite"); info!("Opening Sqlite database at: {}", db_path.display()); let db = db::sqlite_adapter::rusqlite::Connection::open(db_path) + .and_then(|db| { + db.pragma_update(None, "journal_mode", &"WAL")?; + db.pragma_update(None, "synchronous", &"NORMAL")?; + Ok(db) + }) .ok_or_message("Unable to open sqlite DB")?; db::sqlite_adapter::SqliteDb::init(db) } @@ -133,7 +138,6 @@ impl Garage { env_builder.max_readers(500); env_builder.map_size(map_size); unsafe { - env_builder.flag(heed::flags::Flags::MdbNoSync); env_builder.flag(heed::flags::Flags::MdbNoMetaSync); } let db = match env_builder.open(&db_path) { |