Backup: restic backup refactoring

This commit is contained in:
2025-12-20 21:31:39 +03:00
parent 2655869814
commit 037e0cab9b

View File

@@ -93,8 +93,13 @@ class ResticStorage(Storage):
if not backup_dirs:
logger.warning("No backup directories found")
return True
try:
return self.__backup_internal(backup_dirs)
except Exception as exc: # noqa: BLE001
logger.error("Restic backup process failed: %s", exc)
return False
def __backup_internal(self, backup_dirs: List[str]) -> bool:
logger.info("Starting restic backup")
logger.info("Destination: %s", self.restic_repository)
@@ -154,10 +159,6 @@ class ResticStorage(Storage):
logger.info("Final restic check completed successfully")
return True
except Exception as exc: # noqa: BLE001
logger.error("Restic backup process failed: %s", exc)
return False
class BackupManager:
def __init__(self, config: Config, storages: List[Storage]):