refactor(backups): repo init service method

This commit is contained in:
Houkime 2023-02-17 16:11:17 +00:00
parent 86e2b90bef
commit bd744ba211
2 changed files with 8 additions and 0 deletions

View file

@ -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()

View file

@ -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