Fix restic env in health check

This commit is contained in:
2026-02-07 22:12:51 +03:00
parent 588127c076
commit 2a6f8a9c54

View File

@@ -1,5 +1,7 @@
import os
import subprocess
import psutil
from app import RESTIC_ENV
from services.system import worst_disk_usage
@@ -11,7 +13,9 @@ def health(cfg, container_map: dict | None = None) -> str:
lines = ["🩺 Health check\n"]
try:
subprocess.check_output(["restic", "snapshots"], timeout=10)
env = os.environ.copy()
env.update(RESTIC_ENV)
subprocess.check_output(["restic", "snapshots"], timeout=10, env=env)
lines.append("🟢 Backup repo reachable")
except Exception:
lines.append("🔴 Backup repo unreachable")