fix: wecom-alert 发送失败时在日志留档报警内容

This commit is contained in:
yeuimu
2026-08-27 09:43:26 +00:00
parent 1d0da2a00b
commit aa9a021ac4
+3 -1
View File
@@ -111,7 +111,9 @@ def wecom_alert_failure(event: dict | str | None = None) -> dict:
result["sent"] = send_markdown("\n".join(lines)) result["sent"] = send_markdown("\n".join(lines))
result.update({"flowName": flow_name or None, "runId": run_id}) result.update({"flowName": flow_name or None, "runId": run_id})
print(f"[wecom-alert] 已发送失败报警: {flow_name or resource_name} ({event_name})") if not result["sent"]:
print(f"[wecom-alert] 报警内容(发送失败,留档): {' '.join(lines)[:400]}")
print(f"[wecom-alert] 已处理失败报警: {flow_name or resource_name} ({event_name})")
except Exception as err: # noqa: BLE001 except Exception as err: # noqa: BLE001
print(f"[wecom-alert] 报警流程异常(已吞掉,避免自我触发): {err}") print(f"[wecom-alert] 报警流程异常(已吞掉,避免自我触发): {err}")
return result return result