Add runtime state, auto-mute schedules, and backup retries
This commit is contained in:
7
app.py
7
app.py
@@ -1,5 +1,6 @@
|
||||
from aiogram import Bot, Dispatcher
|
||||
from config import load_cfg, load_env
|
||||
from services import runtime_state
|
||||
|
||||
cfg = load_cfg()
|
||||
|
||||
@@ -12,8 +13,10 @@ else:
|
||||
ADMIN_ID = int(cfg["telegram"]["admin_id"])
|
||||
ADMIN_IDS = [ADMIN_ID]
|
||||
|
||||
ARTIFACT_STATE = cfg["paths"]["artifact_state"]
|
||||
RESTIC_ENV = load_env(cfg["paths"].get("restic_env", "/etc/restic/restic.env"))
|
||||
paths_cfg = cfg.get("paths", {})
|
||||
runtime_state.configure(paths_cfg.get("runtime_state", "/var/server-bot/runtime.json"))
|
||||
ARTIFACT_STATE = paths_cfg["artifact_state"]
|
||||
RESTIC_ENV = load_env(paths_cfg.get("restic_env", "/etc/restic/restic.env"))
|
||||
|
||||
DISK_WARN = int(cfg.get("thresholds", {}).get("disk_warn", 80))
|
||||
LOAD_WARN = float(cfg.get("thresholds", {}).get("load_warn", 2.0))
|
||||
|
||||
Reference in New Issue
Block a user