File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -47,9 +47,22 @@ class TokenMemoryCache:
4747 def __init__ (self ):
4848 self .tokens = {}
4949 self .forbid_concurrent_cache_access = threading .Lock ()
50- self .forbid_concurrent_cache_access_async = asyncio . Lock ()
50+ self ._forbid_concurrent_cache_access_async = None
5151 self .forbid_concurrent_missing_token_function_call = threading .Lock ()
52- self .forbid_concurrent_missing_token_function_call_async = asyncio .Lock ()
52+ self ._forbid_concurrent_missing_token_function_call_async = None
53+
54+ @property
55+ def forbid_concurrent_cache_access_async (self ):
56+ if self ._forbid_concurrent_cache_access_async is None :
57+ self ._forbid_concurrent_cache_access_async = asyncio .Lock ()
58+ return self ._forbid_concurrent_cache_access_async
59+
60+ @property
61+ def forbid_concurrent_missing_token_function_call_async (self ):
62+ if self ._forbid_concurrent_missing_token_function_call_async is None :
63+ self ._forbid_concurrent_missing_token_function_call_async = asyncio .Lock ()
64+ return self ._forbid_concurrent_missing_token_function_call_async
65+
5366
5467 def _add_bearer_token (self , key : str , token : str ):
5568 """
You can’t perform that action at this time.
0 commit comments