mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-25 21:41:27 +00:00
feature(backups): also create a job if not called from a task
This commit is contained in:
parent
b32ca3b11a
commit
029cb47db6
|
@ -15,6 +15,7 @@ from selfprivacy_api.graphql.queries.providers import BackupProvider
|
|||
from selfprivacy_api.backup.providers.provider import AbstractBackupProvider
|
||||
from selfprivacy_api.backup.providers import get_provider
|
||||
from selfprivacy_api.backup.storage import Storage
|
||||
from selfprivacy_api.backup.jobs import get_backup_job, add_backup_job
|
||||
|
||||
|
||||
class Backups:
|
||||
|
@ -197,6 +198,9 @@ class Backups:
|
|||
folders = service.get_folders()
|
||||
repo_name = service.get_id()
|
||||
|
||||
if get_backup_job(service) is None:
|
||||
add_backup_job(service)
|
||||
|
||||
service.pre_backup()
|
||||
snapshot = Backups.provider().backuper.start_backup(folders, repo_name)
|
||||
Backups._store_last_snapshot(repo_name, snapshot)
|
||||
|
|
Loading…
Reference in a new issue