mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 23:41:17 -05:00
Change the query to get the notifications for the check_templated_letter_state.
Now looking at the updated_at date, we are getting the alert if the notification was created_at:17:29 updated to created status at 17:30, so the letter is in the next days bucket. Not sure if I want to make this change, there isn't an index on updated_at, so the query might be slow.
This commit is contained in:
@@ -689,11 +689,11 @@ def dao_old_letters_with_created_status():
|
||||
last_processing_deadline = yesterday_bst.replace(hour=17, minute=30, second=0, microsecond=0)
|
||||
|
||||
notifications = Notification.query.filter(
|
||||
Notification.created_at < convert_bst_to_utc(last_processing_deadline),
|
||||
Notification.updated_at < convert_bst_to_utc(last_processing_deadline),
|
||||
Notification.notification_type == LETTER_TYPE,
|
||||
Notification.status == NOTIFICATION_CREATED
|
||||
).order_by(
|
||||
Notification.created_at
|
||||
Notification.updated_at
|
||||
).all()
|
||||
return notifications
|
||||
|
||||
|
||||
Reference in New Issue
Block a user