Add safe config fallbacks for app init and health checks
This commit is contained in:
@@ -9,7 +9,9 @@ def validate_cfg(cfg: dict[str, Any]) -> Tuple[List[str], List[str]]:
|
||||
tg = cfg.get("telegram", {})
|
||||
if not tg.get("token"):
|
||||
errors.append("telegram.token is missing")
|
||||
if not tg.get("admin_id"):
|
||||
admin_ids = tg.get("admin_ids")
|
||||
has_admin_ids = isinstance(admin_ids, list) and len(admin_ids) > 0
|
||||
if not tg.get("admin_id") and not has_admin_ids:
|
||||
errors.append("telegram.admin_id is missing")
|
||||
|
||||
thresholds = cfg.get("thresholds", {})
|
||||
|
||||
Reference in New Issue
Block a user