File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -178,7 +178,7 @@ async def get_token_async(
178178 :raise AuthenticationFailed: in case token cannot be retrieved.
179179 """
180180 logger .debug (f'Retrieving token with "{ key } " key.' )
181- with self .forbid_concurrent_cache_access_async :
181+ async with self .forbid_concurrent_cache_access_async :
182182 self ._load_tokens ()
183183 if key in self .tokens :
184184 bearer , expiry = self .tokens [key ]
@@ -193,7 +193,7 @@ async def get_token_async(
193193
194194 logger .debug ("Token cannot be found in cache." )
195195 if on_missing_token is not None :
196- with self .forbid_concurrent_missing_token_function_call_async :
196+ async with self .forbid_concurrent_missing_token_function_call_async :
197197 new_token = await on_missing_token (** on_missing_token_kwargs )
198198 if len (new_token ) == 2 : # Bearer token
199199 state , token = new_token
@@ -205,7 +205,7 @@ async def get_token_async(
205205 logger .warning (
206206 f"Using a token received on another key than expected. Expecting { key } but was { state } ."
207207 )
208- with self .forbid_concurrent_cache_access_async :
208+ async with self .forbid_concurrent_cache_access_async :
209209 if state in self .tokens :
210210 bearer , expiry = self .tokens [state ]
211211 logger .debug (
You can’t perform that action at this time.
0 commit comments