add webhook failure reason (#3046)

This commit is contained in:
LawyZheng
2025-07-29 00:12:44 +08:00
committed by GitHub
parent a90d08476f
commit 12cbe1b3d2
10 changed files with 100 additions and 6 deletions

View File

@@ -1726,6 +1726,11 @@ async def send_task_v2_webhook(task_v2: TaskV2) -> None:
resp_code=resp.status_code,
resp_text=resp.text,
)
await app.DATABASE.update_task_v2(
task_v2_id=task_v2.observer_cruise_id,
organization_id=task_v2.organization_id,
webhook_failure_reason="",
)
else:
LOG.info(
"Task v2 webhook failed",
@@ -1734,5 +1739,10 @@ async def send_task_v2_webhook(task_v2: TaskV2) -> None:
resp_code=resp.status_code,
resp_text=resp.text,
)
await app.DATABASE.update_task_v2(
task_v2_id=task_v2.observer_cruise_id,
organization_id=task_v2.organization_id,
webhook_failure_reason=f"Webhook failed with status code {resp.status_code}, error message: {resp.text}",
)
except Exception as e:
raise FailedToSendWebhook(task_v2_id=task_v2.observer_cruise_id) from e