File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -190,6 +190,17 @@ class AtlanClient(BaseSettings):
190
190
class Config :
191
191
env_prefix = "atlan_"
192
192
193
+ @classmethod
194
+ def init_for_thread (cls , client : AtlanClient ):
195
+ """
196
+ Prepares the given client for use in the current thread.
197
+
198
+ Sets the thread-local context and
199
+ resets internal retry flags for multi-threaded environments.
200
+ """
201
+ AtlanClient .set_current_client (client )
202
+ client ._401_tls .has_retried = False
203
+
193
204
@classmethod
194
205
def set_current_client (cls , client : AtlanClient ):
195
206
"""
@@ -222,8 +233,7 @@ def __init__(self, **data):
222
233
adapter = HTTPAdapter (max_retries = self .retry )
223
234
session .mount (HTTPS_PREFIX , adapter )
224
235
session .mount (HTTP_PREFIX , adapter )
225
- AtlanClient .set_current_client (self )
226
- self ._401_tls .has_retried = False
236
+ AtlanClient .init_for_thread (self )
227
237
228
238
@property
229
239
def admin (self ) -> AdminClient :
You can’t perform that action at this time.
0 commit comments