fix apply config event

This commit is contained in:
Антон
2026-02-08 19:10:35 +03:00
parent 0ccdfcf7bf
commit e5c0e154b5
2 changed files with 15 additions and 0 deletions

View File

@@ -200,6 +200,17 @@ def get_process_stats():
"uptime": None
}
def get_os_type() -> str:
"""
Detects the host OS type to determine which service manager to use.
Currently supports: 'alpine', 'debian' (fallback for systemd systems).
"""
if os.path.exists("/etc/alpine-release"):
return "alpine"
# Fallback to debian/ubuntu (systemd)
return "debian"
def format_seconds(seconds: float) -> str:
seconds = int(seconds)
days, seconds = divmod(seconds, 86400)