mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-23 04:21:29 +00:00
feat(backup): hooks
This commit is contained in:
parent
bf263f68b9
commit
3970524bce
|
@ -37,4 +37,7 @@ class Backups(metaclass=SingletonMetaclass):
|
||||||
def back_up(self, service: Service):
|
def back_up(self, service: Service):
|
||||||
folder = service.get_location()
|
folder = service.get_location()
|
||||||
repo_name = service.get_id()
|
repo_name = service.get_id()
|
||||||
|
|
||||||
|
service.pre_backup()
|
||||||
self.provider.backuper.start_backup(folder, repo_name)
|
self.provider.backuper.start_backup(folder, repo_name)
|
||||||
|
service.post_restore()
|
||||||
|
|
|
@ -138,3 +138,9 @@ class Service(ABC):
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def move_to_volume(self, volume: BlockDevice) -> Job:
|
def move_to_volume(self, volume: BlockDevice) -> Job:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def pre_backup(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def post_restore(self):
|
||||||
|
pass
|
||||||
|
|
Loading…
Reference in a new issue