feat(backup): hooks

This commit is contained in:
Houkime 2023-02-08 15:27:49 +00:00
parent bf263f68b9
commit 3970524bce
2 changed files with 9 additions and 0 deletions

View file

@ -37,4 +37,7 @@ class Backups(metaclass=SingletonMetaclass):
def back_up(self, service: Service):
folder = service.get_location()
repo_name = service.get_id()
service.pre_backup()
self.provider.backuper.start_backup(folder, repo_name)
service.post_restore()

View file

@ -138,3 +138,9 @@ class Service(ABC):
@abstractmethod
def move_to_volume(self, volume: BlockDevice) -> Job:
pass
def pre_backup(self):
pass
def post_restore(self):
pass