fix(alerts): close controlled canary lifecycle
All checks were successful
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 2m33s
CD Pipeline / build-and-deploy (push) Successful in 6m43s
CD Pipeline / post-deploy-checks (push) Successful in 1m48s
AWOOOI Harbor 110 Local Repair / workflow-shape (push) Successful in 1s
AWOOOI Harbor 110 Local Repair / harbor-110-local-repair (push) Successful in 50s

This commit is contained in:
ogt
2026-07-11 11:46:08 +08:00
parent 46d2fe0c27
commit 847a6ed0d5
10 changed files with 528 additions and 45 deletions

View File

@@ -74,6 +74,7 @@ class AlertOperationLogRepository:
success: bool | None = None,
error_message: str | None = None,
context: dict[str, Any] | None = None,
project_id: str | None = None,
) -> AlertOperationLog | None:
"""
寫入一筆操作事件
@@ -102,7 +103,12 @@ class AlertOperationLogRepository:
return None
try:
async with get_db_context() as db:
db_context = (
get_db_context(project_id)
if project_id
else get_db_context()
)
async with db_context as db:
record = AlertOperationLog(
incident_id=incident_id,
approval_id=approval_id,