File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
packages/smithy-aws-core/src/smithy_aws_core/credentials_resolvers Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 11# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22# SPDX-License-Identifier: Apache-2.0
33import json
4- import threading
4+ import asyncio
55from dataclasses import dataclass
66from datetime import datetime , timedelta
77from typing import Literal
@@ -55,7 +55,7 @@ def __init__(
5555 self ._http_client = http_client
5656 self ._base_uri = base_uri
5757 self ._token_ttl = self ._validate_token_ttl (token_ttl )
58- self ._refresh_lock = threading .Lock ()
58+ self ._refresh_lock = asyncio .Lock ()
5959 self ._token = None
6060
6161 def _validate_token_ttl (self , ttl : int ) -> int :
@@ -72,7 +72,7 @@ def _should_refresh(self) -> bool:
7272
7373 async def _refresh (self ) -> None :
7474 """Refreshes the token if needed, with thread safety."""
75- with self ._refresh_lock :
75+ async with self ._refresh_lock :
7676 if not self ._should_refresh ():
7777 return
7878 headers = Fields (
You can’t perform that action at this time.
0 commit comments