add webhook support for observer (#1546)

This commit is contained in:
Shuchang Zheng 2025-01-14 08:59:53 -08:00 committed by GitHub
parent 950a4a54f3
commit 0392763998
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 160 additions and 13 deletions

View file

@ -987,9 +987,10 @@ class WorkflowService:
headers=headers,
)
try:
resp = await httpx.AsyncClient().post(
url=workflow_run.webhook_callback_url, data=payload, headers=headers, timeout=httpx.Timeout(30.0)
)
async with httpx.AsyncClient() as client:
resp = await client.post(
url=workflow_run.webhook_callback_url, data=payload, headers=headers, timeout=httpx.Timeout(30.0)
)
if resp.status_code == 200:
LOG.info(
"Webhook sent successfully",