From e32ab92eab8eb57e8cb3e5a523bed15d653d04ce Mon Sep 17 00:00:00 2001 From: Daniel Bernstein Date: Fri, 20 Dec 2024 10:04:49 -0800 Subject: [PATCH] Add UUID to timetracking report s3 key to ensure that each report is uniquely associated with a request. --- src/palace/manager/scripts/playtime_entries.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/palace/manager/scripts/playtime_entries.py b/src/palace/manager/scripts/playtime_entries.py index c22ec9565..44a1730be 100644 --- a/src/palace/manager/scripts/playtime_entries.py +++ b/src/palace/manager/scripts/playtime_entries.py @@ -186,9 +186,10 @@ def do_run(self): email_subject = f"{subject_prefix}Playtime Summaries {formatted_start_date} - {formatted_until_date}" reporting_name_with_no_spaces = reporting_name.replace(" ", "_") + "-" link_extension = "csv" + uid = uuid.uuid4() linked_file_name = ( f"playtime-summary-{reporting_name_with_no_spaces}" - f"{formatted_start_date}-{formatted_until_date}.{link_extension}" + f"{formatted_start_date}-{formatted_until_date}-{uid}.{link_extension}" ) # Write to a temporary file so we don't overflow the memory @@ -210,7 +211,6 @@ def do_run(self): ) if recipient: - uid = uuid.uuid4() key = ( f"{S3Service.DOWNLOADS_PREFIX}/{reporting_name}/" f"{linked_file_name}"