1
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2025-09-06 01:38:09 +00:00

Merge commit '1e5306b820' into 2fa_enforcement

This commit is contained in:
Olivier Martin 2021-04-29 23:29:28 -04:00
commit f707f86c8e
6 changed files with 19 additions and 11 deletions

View file

@ -1,4 +1,3 @@
use chrono::prelude::*;
use diesel::r2d2::{ConnectionManager, Pool, PooledConnection};
use rocket::{
http::Status,
@ -228,12 +227,11 @@ pub fn backup_database(conn: &DbConn) -> Result<(), Error> {
use std::path::Path;
let db_url = CONFIG.database_url();
let db_path = Path::new(&db_url).parent().unwrap().to_string_lossy();
let file_date = Utc::now().format("%Y%m%d_%H%M%S").to_string();
let file_date = chrono::Utc::now().format("%Y%m%d_%H%M%S").to_string();
diesel::sql_query(format!("VACUUM INTO '{}/db_{}.sqlite3'", db_path, file_date)).execute(conn)?;
Ok(())
}
}
Ok(())
}
/// Get the SQL Server version