mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-22 12:11:26 +00:00
feature(backups): set job status to error if backup fails
This commit is contained in:
parent
0bf18dcdc7
commit
b2e231ebae
|
@ -202,11 +202,15 @@ class Backups:
|
|||
job = add_backup_job(service)
|
||||
Jobs.update(job, status=JobStatus.RUNNING)
|
||||
|
||||
service.pre_backup()
|
||||
snapshot = Backups.provider().backuper.start_backup(folders, repo_name)
|
||||
Backups._store_last_snapshot(repo_name, snapshot)
|
||||
try:
|
||||
service.pre_backup()
|
||||
snapshot = Backups.provider().backuper.start_backup(folders, repo_name)
|
||||
Backups._store_last_snapshot(repo_name, snapshot)
|
||||
service.post_restore()
|
||||
except Exception as e:
|
||||
Jobs.update(job, status=JobStatus.ERROR)
|
||||
raise e
|
||||
|
||||
service.post_restore()
|
||||
Jobs.update(job, status=JobStatus.FINISHED)
|
||||
|
||||
@staticmethod
|
||||
|
|
Loading…
Reference in a new issue