Skip to content
Snippets Groups Projects
Commit 4df686f4 authored by Miroslav Prasil's avatar Miroslav Prasil
Browse files

Add an option to not enable WAL (should help in #399)

parent d7eeaaf2
No related branches found
No related tags found
No related merge requests found
......@@ -253,6 +253,9 @@ make_config! {
extended_logging: bool, false, def, true;
/// Log file path
log_file: String, false, option;
/// Enable DB WAL |> Turning this off might lead to worse performance, but might help if using bitwarden_rs on some exotic filesystems, that do not support WAL
enable_db_wal: bool, false, def, true;
},
/// Yubikey settings
......
......@@ -168,11 +168,13 @@ fn check_db() {
}
// Turn on WAL in SQLite
use diesel::RunQueryDsl;
let connection = db::get_connection().expect("Can't conect to DB");
diesel::sql_query("PRAGMA journal_mode=wal")
.execute(&connection)
.expect("Failed to turn on WAL");
if CONFIG.enable_db_wal() {
use diesel::RunQueryDsl;
let connection = db::get_connection().expect("Can't conect to DB");
diesel::sql_query("PRAGMA journal_mode=wal")
.execute(&connection)
.expect("Failed to turn on WAL");
}
}
fn check_rsa_keys() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment