From 3970524bcef39cc98d70d4c9fc66a98bc6bcc124 Mon Sep 17 00:00:00 2001 From: Houkime <> Date: Wed, 8 Feb 2023 15:27:49 +0000 Subject: [PATCH] feat(backup): hooks --- selfprivacy_api/backup/__init__.py | 3 +++ selfprivacy_api/services/service.py | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/selfprivacy_api/backup/__init__.py b/selfprivacy_api/backup/__init__.py index 79125ef..5ddd378 100644 --- a/selfprivacy_api/backup/__init__.py +++ b/selfprivacy_api/backup/__init__.py @@ -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() diff --git a/selfprivacy_api/services/service.py b/selfprivacy_api/services/service.py index 515e28f..f191149 100644 --- a/selfprivacy_api/services/service.py +++ b/selfprivacy_api/services/service.py @@ -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