Aggiunge notifier server per scheduler
This commit is contained in:
@@ -46,6 +46,7 @@ class StorageConfig:
|
||||
change_registry: Path
|
||||
logs_dir: Path
|
||||
status_file: Path
|
||||
notifier_state_file: Path
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@@ -104,11 +105,11 @@ def save_config_data(data: dict[str, Any], path: Path | None = None) -> Path:
|
||||
|
||||
|
||||
def migrate_config_data(data: dict[str, Any]) -> bool:
|
||||
changed = _migrate_storage_config(data)
|
||||
backup = data.get("backup")
|
||||
if not isinstance(backup, dict):
|
||||
return False
|
||||
return changed
|
||||
|
||||
changed = False
|
||||
engine = str(backup.get("engine", "robocopy")).lower()
|
||||
if "engine" not in backup:
|
||||
backup["engine"] = engine
|
||||
@@ -138,6 +139,16 @@ def migrate_config_data(data: dict[str, Any]) -> bool:
|
||||
return changed
|
||||
|
||||
|
||||
def _migrate_storage_config(data: dict[str, Any]) -> bool:
|
||||
storage = data.get("storage")
|
||||
if not isinstance(storage, dict):
|
||||
return False
|
||||
if "notifier_state_file" in storage:
|
||||
return False
|
||||
storage["notifier_state_file"] = "%PROGRAMDATA%\\BakRest\\notifier-state.json"
|
||||
return True
|
||||
|
||||
|
||||
def parse_config(data: dict[str, Any], path: Path) -> AppConfig:
|
||||
service = data.get("service", {})
|
||||
tray = data.get("tray", {})
|
||||
@@ -159,6 +170,9 @@ def parse_config(data: dict[str, Any], path: Path) -> AppConfig:
|
||||
),
|
||||
logs_dir=expand_path(storage.get("logs_dir", "%PROGRAMDATA%\\BakRest\\logs")),
|
||||
status_file=expand_path(storage.get("status_file", "%PROGRAMDATA%\\BakRest\\status.json")),
|
||||
notifier_state_file=expand_path(
|
||||
storage.get("notifier_state_file", "%PROGRAMDATA%\\BakRest\\notifier-state.json")
|
||||
),
|
||||
)
|
||||
|
||||
return AppConfig(
|
||||
|
||||
Reference in New Issue
Block a user