refactor(backups): repo init service method

This commit is contained in:
Houkime 2023-02-17 16:11:17 +00:00
parent d1dbcbae5e
commit ad1b1c4972
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) self.provider.backuper.start_backup(folder, repo_name)
service.post_restore() 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]: def get_snapshots(self, service: Service) -> List[Snapshot]:
repo_name = service.get_id() repo_name = service.get_id()

View file

@ -16,3 +16,7 @@ class AbstractBackuper(ABC):
def get_snapshots(self, repo_name) -> List[Snapshot]: def get_snapshots(self, repo_name) -> List[Snapshot]:
"""Get all snapshots from the repo""" """Get all snapshots from the repo"""
raise NotImplementedError raise NotImplementedError
@abstractmethod
def init(self, repo_name):
raise NotImplementedError