Skip to content

Commit 64027a4

Browse files
committed
resolve the resource leak issue
1 parent 088ba3b commit 64027a4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pyatlan/client/aio/client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,19 +132,21 @@ class AsyncAtlanClient(AtlanClient):
132132
_async_user_cache: Optional[AsyncUserCache] = PrivateAttr(default=None)
133133

134134
def __init__(self, **kwargs):
135-
# Initialize sync client (handles all validation, env vars, etc.)
136135
super().__init__(**kwargs)
137136

138137
if self.oauth_client_id and self.oauth_client_secret:
139138
from pyatlan.client.aio.oauth import AsyncOAuthTokenManager
140139

140+
if self._oauth_token_manager:
141+
self._oauth_token_manager.close()
142+
self._oauth_token_manager = None
143+
141144
self._async_oauth_token_manager = AsyncOAuthTokenManager(
142145
base_url=str(self.base_url),
143146
client_id=self.oauth_client_id,
144147
client_secret=self.oauth_client_secret,
145148
)
146149

147-
# Build proxy/SSL configuration (reuse from sync client)
148150
transport_kwargs = self._build_transport_proxy_config(kwargs)
149151

150152
# Create async session with custom transport that supports retry and proxy

0 commit comments

Comments
 (0)