mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-03-14 10:44:13 +00:00
feature(jobs): set 1 hour ttl for successful autobackup jobs
This commit is contained in:
parent
0912ac1831
commit
26c0a8fafe
1 changed files with 4 additions and 0 deletions
|
@ -56,6 +56,8 @@ BACKUP_PROVIDER_ENVS = {
|
|||
"location": "BACKUP_LOCATION",
|
||||
}
|
||||
|
||||
AUTOBACKUP_JOB_EXPIRATION_SECONDS = 60 * 60 # one hour
|
||||
|
||||
|
||||
class NotDeadError(AssertionError):
|
||||
"""
|
||||
|
@ -316,6 +318,8 @@ class Backups:
|
|||
raise error
|
||||
|
||||
Jobs.update(job, status=JobStatus.FINISHED)
|
||||
if reason in [BackupReason.AUTO, BackupReason.PRE_RESTORE]:
|
||||
Jobs.set_expiration(job, AUTOBACKUP_JOB_EXPIRATION_SECONDS)
|
||||
return snapshot
|
||||
|
||||
@staticmethod
|
||||
|
|
Loading…
Add table
Reference in a new issue