mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-10 01:56:03 -04:00
don't use global s3 client
This commit is contained in:
@@ -69,17 +69,16 @@ def clean_cache():
|
|||||||
|
|
||||||
|
|
||||||
def get_s3_client():
|
def get_s3_client():
|
||||||
global s3_client
|
|
||||||
if s3_client is None:
|
access_key = current_app.config["CSV_UPLOAD_BUCKET"]["access_key_id"]
|
||||||
access_key = current_app.config["CSV_UPLOAD_BUCKET"]["access_key_id"]
|
secret_key = current_app.config["CSV_UPLOAD_BUCKET"]["secret_access_key"]
|
||||||
secret_key = current_app.config["CSV_UPLOAD_BUCKET"]["secret_access_key"]
|
region = current_app.config["CSV_UPLOAD_BUCKET"]["region"]
|
||||||
region = current_app.config["CSV_UPLOAD_BUCKET"]["region"]
|
session = Session(
|
||||||
session = Session(
|
aws_access_key_id=access_key,
|
||||||
aws_access_key_id=access_key,
|
aws_secret_access_key=secret_key,
|
||||||
aws_secret_access_key=secret_key,
|
region_name=region,
|
||||||
region_name=region,
|
)
|
||||||
)
|
s3_client = session.client("s3", config=AWS_CLIENT_CONFIG)
|
||||||
s3_client = session.client("s3", config=AWS_CLIENT_CONFIG)
|
|
||||||
return s3_client
|
return s3_client
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user