Increase webhook request timeout from 10 to 60 seconds (#4653)
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -148,7 +148,7 @@ async def test_webhook(
|
||||
validated_url,
|
||||
content=signed_data.signed_payload,
|
||||
headers=signed_data.headers,
|
||||
timeout=httpx.Timeout(10.0),
|
||||
timeout=httpx.Timeout(60.0),
|
||||
)
|
||||
status_code = response.status_code
|
||||
|
||||
@@ -160,7 +160,7 @@ async def test_webhook(
|
||||
response_body = response_text
|
||||
|
||||
except httpx.TimeoutException:
|
||||
error = "Request timed out after 10 seconds."
|
||||
error = "Request timed out after 60 seconds."
|
||||
LOG.warning(
|
||||
"Test webhook timeout",
|
||||
organization_id=current_org.organization_id,
|
||||
|
||||
@@ -471,7 +471,7 @@ async def _deliver_webhook(
|
||||
|
||||
try:
|
||||
async with httpx.AsyncClient() as client:
|
||||
response = await client.post(url, content=payload, headers=headers, timeout=httpx.Timeout(10.0))
|
||||
response = await client.post(url, content=payload, headers=headers, timeout=httpx.Timeout(60.0))
|
||||
status_code = response.status_code
|
||||
body_text = response.text or ""
|
||||
if len(body_text) > RESPONSE_BODY_TRUNCATION_LIMIT:
|
||||
@@ -479,7 +479,7 @@ async def _deliver_webhook(
|
||||
else:
|
||||
response_body = body_text or None
|
||||
except httpx.TimeoutException:
|
||||
error = "Request timed out after 10 seconds."
|
||||
error = "Request timed out after 60 seconds."
|
||||
LOG.warning("Webhook replay timed out", url=url)
|
||||
except httpx.NetworkError as exc:
|
||||
error = f"Could not reach URL: {exc}"
|
||||
|
||||
Reference in New Issue
Block a user