From f0299c4042b13f129230fed1ad6355246af762b8 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Fri, 27 Sep 2024 08:39:19 -0700 Subject: [PATCH] optimize S3 partitioning --- app/main/views/send.py | 2 +- app/s3_client/s3_csv_client.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/main/views/send.py b/app/main/views/send.py index 7899af5a8..68d15f631 100644 --- a/app/main/views/send.py +++ b/app/main/views/send.py @@ -1027,7 +1027,7 @@ def _send_notification(service_id, template_id): # on the API side to find out what happens to the message. current_app.logger.info( hilite( - f"One-off file: {filename} job_id: {upload_id} s3 location: service-{service_id}-notify/{upload_id}.csv" + f"One-off file: {filename} job_id: {upload_id} s3 location: {service_id}-service-notify/{upload_id}.csv" ) ) diff --git a/app/s3_client/s3_csv_client.py b/app/s3_client/s3_csv_client.py index 752f054a4..09454ade0 100644 --- a/app/s3_client/s3_csv_client.py +++ b/app/s3_client/s3_csv_client.py @@ -10,13 +10,13 @@ from app.s3_client import ( ) from notifications_utils.s3 import s3upload as utils_s3upload -FILE_LOCATION_STRUCTURE = "service-{}-notify/{}.csv" +NEW_FILE_LOCATION_STRUCTURE = "{}-service-notify/{}.csv" def get_csv_location(service_id, upload_id): return ( current_app.config["CSV_UPLOAD_BUCKET"]["bucket"], - FILE_LOCATION_STRUCTURE.format(service_id, upload_id), + NEW_FILE_LOCATION_STRUCTURE.format(service_id, upload_id), current_app.config["CSV_UPLOAD_BUCKET"]["access_key_id"], current_app.config["CSV_UPLOAD_BUCKET"]["secret_access_key"], current_app.config["CSV_UPLOAD_BUCKET"]["region"],