mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-07-05 03:55:02 +00:00
Update chrono and sqlite (#4436)
- Updated sqlite crate - Updated chrono crate The latter needed a lot of changes done, mostly `Duration` to `TimeDelta`. And some changes on how to use Naive.
This commit is contained in:
parent
ce8efcc48f
commit
1e42755187
17 changed files with 56 additions and 56 deletions
|
@ -1,5 +1,5 @@
|
|||
use crate::CONFIG;
|
||||
use chrono::{Duration, NaiveDateTime, Utc};
|
||||
use chrono::{NaiveDateTime, TimeDelta, Utc};
|
||||
use serde_json::Value;
|
||||
|
||||
use super::{
|
||||
|
@ -361,7 +361,7 @@ impl Cipher {
|
|||
pub async fn purge_trash(conn: &mut DbConn) {
|
||||
if let Some(auto_delete_days) = CONFIG.trash_auto_delete_days() {
|
||||
let now = Utc::now().naive_utc();
|
||||
let dt = now - Duration::days(auto_delete_days);
|
||||
let dt = now - TimeDelta::try_days(auto_delete_days).unwrap();
|
||||
for cipher in Self::find_deleted_before(&dt, conn).await {
|
||||
cipher.delete(conn).await.ok();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue