Add support for auto-deleting trashed items

Upstream will soon auto-delete trashed items after 30 days, but some people
use the trash as an archive folder, so to avoid unexpected data loss, this
implementation requires the user to explicitly enable auto-deletion.
This commit is contained in:
Jeremy Lin
2021-04-02 20:52:15 -07:00
parent 73ff8d79f7
commit d77333576b
7 changed files with 54 additions and 2 deletions

View File

@ -354,6 +354,13 @@ fn schedule_jobs(pool: db::DbPool) {
}));
}
// Purge trashed items that are old enough to be auto-deleted.
if !CONFIG.trash_purge_schedule().is_empty() {
sched.add(Job::new(CONFIG.trash_purge_schedule().parse().unwrap(), || {
api::purge_trashed_ciphers(pool.clone());
}));
}
// Periodically check for jobs to run. We probably won't need any
// jobs that run more often than once a minute, so a default poll
// interval of 30 seconds should be sufficient. Users who want to