Add runtime state, auto-mute schedules, and backup retries
This commit is contained in:
@@ -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"):
|
||||
|
||||
Reference in New Issue
Block a user