0
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden synced 2024-11-16 06:52:07 +01:00

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

This commit is contained in:
Miroslav Prasil 2019-02-18 10:48:48 +00:00
parent d7eeaaf249
commit 4df686f49e
2 changed files with 10 additions and 5 deletions

View file

@ -253,6 +253,9 @@ make_config! {
extended_logging: bool, false, def, true; extended_logging: bool, false, def, true;
/// Log file path /// Log file path
log_file: String, false, option; 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 /// Yubikey settings

View file

@ -168,11 +168,13 @@ fn check_db() {
} }
// Turn on WAL in SQLite // Turn on WAL in SQLite
use diesel::RunQueryDsl; if CONFIG.enable_db_wal() {
let connection = db::get_connection().expect("Can't conect to DB"); use diesel::RunQueryDsl;
diesel::sql_query("PRAGMA journal_mode=wal") let connection = db::get_connection().expect("Can't conect to DB");
.execute(&connection) diesel::sql_query("PRAGMA journal_mode=wal")
.expect("Failed to turn on WAL"); .execute(&connection)
.expect("Failed to turn on WAL");
}
} }
fn check_rsa_keys() { fn check_rsa_keys() {