fix(alerts): 補齊處置結果與人工通知契約
This commit is contained in:
@@ -660,6 +660,8 @@ class ApprovalDBService:
|
||||
success: bool,
|
||||
error_message: str | None = None,
|
||||
execution_kind: str | None = None,
|
||||
repair_executed: bool | None = None,
|
||||
repair_attempted: bool | None = None,
|
||||
) -> None:
|
||||
"""
|
||||
更新執行狀態
|
||||
@@ -691,7 +693,18 @@ class ApprovalDBService:
|
||||
# 但前台/報表必須能分辨「未執行修復」而非真正 execution success。
|
||||
metadata = dict(record.extra_metadata or {})
|
||||
metadata["execution_kind"] = execution_kind
|
||||
metadata["repair_executed"] = execution_kind != "no_action"
|
||||
metadata["repair_executed"] = (
|
||||
repair_executed
|
||||
if repair_executed is not None
|
||||
else execution_kind not in {
|
||||
"no_action",
|
||||
"diagnostic",
|
||||
"parse_failed",
|
||||
"unsupported_action",
|
||||
}
|
||||
)
|
||||
if repair_attempted is not None:
|
||||
metadata["repair_attempted"] = repair_attempted
|
||||
record.extra_metadata = metadata
|
||||
|
||||
logger.info(
|
||||
|
||||
Reference in New Issue
Block a user