mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 01:41:05 -05:00
In this PR we remove trigger-letter-pdfs-for-day scheduled task and just call collate_letter_pdfs_for_day instead.
There was a datetime bug in the query which resulted in files not being sent to the postal provider. The trigger-letter-pdfs-for-day task is no longer needed, so rather than fix the query just call collate_letter_pdfs_for_day directly. Less code is always better. Deployment considerations: I realized this is strictly not backwards compatible if the scheduled job is in progress and a task is on the queue that no longer exists. This is ok since we will deploy this well before 17:50.
This commit is contained in:
@@ -105,7 +105,12 @@ def get_letters_pdf(template, contact_block, org_id, values):
|
||||
|
||||
|
||||
@notify_celery.task(name='collate-letter-pdfs-for-day')
|
||||
def collate_letter_pdfs_for_day(date):
|
||||
def collate_letter_pdfs_for_day(date=None):
|
||||
if not date:
|
||||
# Using the truncated date is ok because UTC to BST does not make a difference to the date,
|
||||
# since it is triggered mid afternoon.
|
||||
date = datetime.utcnow().strftime("%Y-%m-%d")
|
||||
|
||||
letter_pdfs = s3.get_s3_bucket_objects(
|
||||
current_app.config['LETTERS_PDF_BUCKET_NAME'],
|
||||
subfolder=date
|
||||
|
||||
Reference in New Issue
Block a user