Skip to content

Commit 00b43be

Browse files
authored
Extend timeout for httpx put in submission (#632)
1 parent 2540895 commit 00b43be

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

servicex/servicex_adapter.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
from typing import Optional, Dict, List
3232
from dataclasses import dataclass
3333

34-
from httpx import AsyncClient, Response
34+
from httpx import AsyncClient, Response, Timeout
3535
from json import JSONDecodeError
3636
from httpx_retries import RetryTransport, Retry
3737
from google.auth import jwt
@@ -71,6 +71,9 @@ async def _extract_message(r: Response):
7171
return error_message
7272

7373

74+
_timeout = Timeout(10, read=300)
75+
76+
7477
class ServiceXAdapter:
7578
def __init__(self, url: str, refresh_token: Optional[str] = None):
7679
self.url = url
@@ -349,7 +352,9 @@ async def cancel_transform(self, transform_id=None):
349352
async def submit_transform(self, transform_request: TransformRequest) -> str:
350353
headers = await self._get_authorization()
351354
retry_options = Retry(total=3, backoff_factor=30)
352-
async with AsyncClient(transport=RetryTransport(retry=retry_options)) as client:
355+
async with AsyncClient(
356+
transport=RetryTransport(retry=retry_options), timeout=_timeout
357+
) as client:
353358
r = await client.post(
354359
url=f"{self.url}/servicex/transformation",
355360
headers=headers,

0 commit comments

Comments
 (0)