1
0
Fork 1
Spiegel von https://github.com/dani-garcia/vaultwarden.git synchronisiert 2024-11-26 05:50:29 +01:00

Merge pull request #404 from mprasil/disable_wal

Add an option to not enable WAL (should help in #399)
Dieser Commit ist enthalten in:
Daniel García 2019-02-18 16:10:16 +01:00 committet von GitHub
Commit 72de16fb86
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
3 geänderte Dateien mit 18 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -43,6 +43,14 @@
## It's recommended to also set 'ROCKET_CLI_COLORS=off' ## It's recommended to also set 'ROCKET_CLI_COLORS=off'
# LOG_FILE=/path/to/log # LOG_FILE=/path/to/log
## Enable WAL for the DB
## Set to false to avoid enabling WAL during startup.
## Note that if the DB already has WAL enabled, you will also need to disable WAL in the DB,
## this setting only prevents bitwarden_rs from automatically enabling it on start.
## Please read project wiki page about this setting first before changing the value as it can
## cause performance degradation or might render the service unable to start.
# ENABLE_DB_WAL=true
## Disable icon downloading ## Disable icon downloading
## Set to true to disable icon downloading, this would still serve icons from $ICON_CACHE_FOLDER, ## Set to true to disable icon downloading, this would still serve icons from $ICON_CACHE_FOLDER,
## but it won't produce any external network request. Needs to set $ICON_CACHE_TTL to 0, ## but it won't produce any external network request. Needs to set $ICON_CACHE_TTL to 0,

Datei anzeigen

@ -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. Please make sure you read project wiki on the topic before changing this setting.
enable_db_wal: bool, false, def, true;
}, },
/// Yubikey settings /// Yubikey settings

Datei anzeigen

@ -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() {