Skip to content

Commit

Permalink
Use boto3 session instead of boto3 client
Browse files Browse the repository at this point in the history
boto3 client has known issues for multithreading. boto/boto3#801
One solution is to use session instead.
  • Loading branch information
superpilot authored and mvantellingen committed Aug 19, 2024
1 parent 1c9f4ce commit ce6e27f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/django_iam_dbauth/aws/database_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ def get_aws_connection_params(params):
enabled = params.pop("use_iam_auth", None)
if enabled:
region_name = params.pop("region_name", None)
rds_client = boto3.client(service_name="rds", region_name=region_name)
session = boto3.session.Session()
rds_client = session.client(service_name="rds", region_name=region_name)

hostname = params.get("host")
if hostname:
Expand Down

0 comments on commit ce6e27f

Please sign in to comment.