fix(ansible): persist scheduled candidate incidents

This commit is contained in:
ogt
2026-07-15 20:25:17 +08:00
parent a3dbd06c5f
commit cc4265c076
4 changed files with 55 additions and 3 deletions

View File

@@ -84,6 +84,7 @@ SignalSource = Literal[
"node-exporter",
"sensor-probe",
"sensor-agent",
"iwooos_scheduler",
]
SIGNAL_SOURCE_VALUES: frozenset[str] = frozenset(get_args(SignalSource))

View File

@@ -1520,7 +1520,11 @@ async def _ensure_ansible_incident_ledger_with_db(
proposal_ids,
alertname,
notification_type,
alert_category
alert_category,
created_at,
updated_at,
ttl_days,
vectorized
) VALUES (
:incident_id,
:project_id,
@@ -1532,7 +1536,11 @@ async def _ensure_ansible_incident_ledger_with_db(
CAST('[]' AS json),
:alertname,
:notification_type,
:alert_category
:alert_category,
NOW(),
NOW(),
7,
FALSE
)
ON CONFLICT (incident_id) DO NOTHING
RETURNING incident_id