Skip to content

Commit

Permalink
Add UUID to timetracking report s3 key to ensure that each report is …
Browse files Browse the repository at this point in the history
…uniquely associated with a request.
  • Loading branch information
dbernstein committed Dec 20, 2024
1 parent 13da746 commit e32ab92
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/palace/manager/scripts/playtime_entries.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -210,7 +211,6 @@ def do_run(self):
)

if recipient:
uid = uuid.uuid4()
key = (
f"{S3Service.DOWNLOADS_PREFIX}/{reporting_name}/"
f"{linked_file_name}"
Expand Down

0 comments on commit e32ab92

Please sign in to comment.