Skip to content

Commit d1b3311

Browse files
vaibhavatlanAryamanz29
authored andcommitted
timeout fix
1 parent 028feb9 commit d1b3311

4 files changed

Lines changed: 18 additions & 2 deletions

File tree

pyatlan/client/aio/client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ def __init__(self, **kwargs):
159159
base_url=final_base_url,
160160
client_id=final_oauth_client_id,
161161
client_secret=final_oauth_client_secret,
162+
connect_timeout=self.connect_timeout,
163+
read_timeout=self.read_timeout,
162164
)
163165

164166
# Build proxy/SSL configuration (reuse from sync client)

pyatlan/client/aio/oauth.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,19 @@ def __init__(
1818
client_id: str,
1919
client_secret: str,
2020
http_client: Optional[httpx.AsyncClient] = None,
21+
connect_timeout: float = 30.0,
22+
read_timeout: float = 900.0,
2123
):
2224
self.base_url = base_url
2325
self.client_id = client_id
2426
self.client_secret = client_secret
2527
self.token_url = self._create_path(GET_OAUTH_CLIENT)
2628
self._lock = asyncio.Lock()
27-
self._http_client = http_client or httpx.AsyncClient(timeout=30.0)
29+
self._http_client = http_client or httpx.AsyncClient(
30+
timeout=httpx.Timeout(
31+
connect=connect_timeout, read=read_timeout, write=30.0, pool=30.0
32+
)
33+
)
2834
self._token: Optional[OAuth2Token] = None
2935
self._owns_client = http_client is None
3036

pyatlan/client/atlan.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ def __init__(self, **data):
193193
base_url=final_base_url,
194194
client_id=final_oauth_client_id,
195195
client_secret=final_oauth_client_secret,
196+
connect_timeout=self.connect_timeout,
197+
read_timeout=self.read_timeout,
196198
)
197199
self._request_params = {"headers": {}}
198200
else:

pyatlan/client/oauth.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,19 @@ def __init__(
1818
client_id: str,
1919
client_secret: str,
2020
http_client: Optional[httpx.Client] = None,
21+
connect_timeout: float = 30.0,
22+
read_timeout: float = 900.0,
2123
):
2224
self.base_url = base_url
2325
self.client_id = client_id
2426
self.client_secret = client_secret
2527
self.token_url = self._create_path(GET_OAUTH_CLIENT)
2628
self._lock = threading.Lock()
27-
self._http_client = http_client or httpx.Client(timeout=30.0)
29+
self._http_client = http_client or httpx.Client(
30+
timeout=httpx.Timeout(
31+
connect=connect_timeout, read=read_timeout, write=30.0, pool=30.0
32+
)
33+
)
2834
self._token: Optional[OAuth2Token] = None
2935
self._owns_client = http_client is None
3036

0 commit comments

Comments
 (0)