Add runtime state, auto-mute schedules, and backup retries

This commit is contained in:
2026-02-09 01:14:37 +03:00
parent 9399be4168
commit b0a4413671
14 changed files with 312 additions and 17 deletions

View File

@@ -2,7 +2,7 @@ import time
from datetime import datetime
from aiogram import Bot
from app import cfg
from services.alert_mute import is_muted
from services.alert_mute import is_muted, is_auto_muted
from services.incidents import log_incident
@@ -49,6 +49,8 @@ async def notify(
alerts_cfg = cfg.get("alerts", {})
if category and is_muted(category):
return
if category and is_auto_muted(cfg, category):
return
if _in_quiet_hours(alerts_cfg):
allow_critical = bool(alerts_cfg.get("quiet_hours", {}).get("allow_critical", True))
if not (allow_critical and level == "critical"):