This commit is contained in:
Kenneth Kehl
2025-01-09 11:28:24 -08:00
parent fbd8643e74
commit 16bba7e4c4
3 changed files with 40 additions and 19 deletions

View File

@@ -10,7 +10,6 @@ from boto3 import Session
from flask import current_app
from app.clients import AWS_CLIENT_CONFIG
from app.utils import hilite
from notifications_utils import aware_utcnow
FILE_LOCATION_STRUCTURE = "service-{}-notify/{}.csv"
@@ -84,7 +83,6 @@ def get_s3_client():
def get_s3_resource():
global s3_resource
if s3_resource is None:
print(hilite("S3 RESOURCE IS NONE, CREATING IT!"))
access_key = current_app.config["CSV_UPLOAD_BUCKET"]["access_key_id"]
secret_key = current_app.config["CSV_UPLOAD_BUCKET"]["secret_access_key"]
region = current_app.config["CSV_UPLOAD_BUCKET"]["region"]
@@ -94,8 +92,6 @@ def get_s3_resource():
region_name=region,
)
s3_resource = session.resource("s3", config=AWS_CLIENT_CONFIG)
else:
print(hilite("S3 RESOURCE ALREADY EXSITS, REUSING IT!"))
return s3_resource