From ad1b1c4972dfca546aa1227426f39881bed4ce8c Mon Sep 17 00:00:00 2001 From: Houkime <> Date: Fri, 17 Feb 2023 16:11:17 +0000 Subject: [PATCH] refactor(backups): repo init service method --- selfprivacy_api/backup/__init__.py | 4 ++++ selfprivacy_api/backup/backuper.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/selfprivacy_api/backup/__init__.py b/selfprivacy_api/backup/__init__.py index 4410809..210c998 100644 --- a/selfprivacy_api/backup/__init__.py +++ b/selfprivacy_api/backup/__init__.py @@ -46,6 +46,10 @@ class Backups(metaclass=SingletonMetaclass): self.provider.backuper.start_backup(folder, repo_name) service.post_restore() + def init_repo(self, service: Service): + repo_name = service.get_id() + self.provider.backuper.init(repo_name) + def get_snapshots(self, service: Service) -> List[Snapshot]: repo_name = service.get_id() diff --git a/selfprivacy_api/backup/backuper.py b/selfprivacy_api/backup/backuper.py index c2353ad..676a0a1 100644 --- a/selfprivacy_api/backup/backuper.py +++ b/selfprivacy_api/backup/backuper.py @@ -16,3 +16,7 @@ class AbstractBackuper(ABC): def get_snapshots(self, repo_name) -> List[Snapshot]: """Get all snapshots from the repo""" raise NotImplementedError + + @abstractmethod + def init(self, repo_name): + raise NotImplementedError