mirror of
https://github.com/dani-garcia/vaultwarden.wiki.git
synced 2026-10-24 14:43:39 +03:00
MySQL database
This commit is contained in:
1 parent
1eb1502a07
commit
42af7c6dab
3 files changed
+5
-22
No files matched your search
+1
-18
@@ -123,24 +123,7 @@ fn chain_syslog(logger: fern::Dispatch) -> fern::Dispatch {
|
||||
|
||||
fn check_db() {
|
||||
let url = CONFIG.database_url();
|
||||
let path = Path::new(&url);
|
||||
|
||||
if let Some(parent) = path.parent() {
|
||||
use std::fs;
|
||||
if fs::create_dir_all(parent).is_err() {
|
||||
error!("Error creating database directory");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
// Turn on WAL in SQLite
|
||||
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");
|
||||
}
|
||||
println!(url.to_string());
|
||||
}
|
||||
|
||||
fn check_rsa_keys() {
|
||||
|
||||
Reference in new issue
Block a user