feat: extend azure timeout (#6284)

This commit is contained in:
cthomas
2025-11-19 19:31:58 -08:00
committed by Caren Thomas
parent 0e92850c95
commit f6fb9aed3f

View File

@@ -78,9 +78,13 @@ class AzureProvider(Provider):
# 2. Get all the deployed models
url = self.get_azure_deployment_list_endpoint()
try:
async with httpx.AsyncClient() as http_client:
# Azure API can be slow (8+ seconds), use a generous timeout
timeout = httpx.Timeout(15.0, connect=10.0)
async with httpx.AsyncClient(timeout=timeout) as http_client:
response = await http_client.get(url, headers=headers)
response.raise_for_status()
except httpx.TimeoutException as e:
raise RuntimeError(f"Azure API timeout after 15s: {e}")
except httpx.HTTPStatusError as e:
raise RuntimeError(f"Failed to retrieve model list: {e}")