From 029cb47db62a5e2dd320c83788365e10e7f08ee0 Mon Sep 17 00:00:00 2001 From: Houkime <> Date: Mon, 24 Apr 2023 16:15:12 +0000 Subject: [PATCH] feature(backups): also create a job if not called from a task --- selfprivacy_api/backup/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/selfprivacy_api/backup/__init__.py b/selfprivacy_api/backup/__init__.py index f89a54e..0f35456 100644 --- a/selfprivacy_api/backup/__init__.py +++ b/selfprivacy_api/backup/__init__.py @@ -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)