mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 07:35:34 -05:00
After a comment from @idavidmcdonald, I asked myself why are not creating the task to upload the pdf and update the notification.
The assumption was that S3 would throw an exception if the object was uploaded twice. That's not the case the default behaviour is that if a file already exists it will be overwritten. So it is completely safe to run the task from the alert. It can also mean that we don't need to wait 4hours 15 minutes. Shall I decease the amount of time before restarting the task?
This commit is contained in:
@@ -710,11 +710,11 @@ def dao_old_letters_with_created_status():
|
||||
|
||||
def letters_missing_from_sending_bucket(seconds_to_subtract):
|
||||
older_than_date = datetime.utcnow() - timedelta(seconds=seconds_to_subtract)
|
||||
|
||||
# We expect letters to have a `created` status, updated_at timestamp and billable units greater than zero.
|
||||
notifications = Notification.query.filter(
|
||||
Notification.billable_units == 0,
|
||||
Notification.updated_at == None, # noqa
|
||||
Notification.status == NOTIFICATION_CREATED,
|
||||
Notification.billable_units == 0,
|
||||
Notification.created_at <= older_than_date,
|
||||
Notification.notification_type == LETTER_TYPE,
|
||||
Notification.key_type == KEY_TYPE_NORMAL
|
||||
|
||||
Reference in New Issue
Block a user