mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-22 00:11:16 -05:00
If a sms or email has not been sent after 4 hours and 15 minutes then put it on the delivery queue.
This commit is contained in:
@@ -600,3 +600,14 @@ def dao_get_count_of_letters_to_process_for_date(date_to_process=None):
|
||||
).count()
|
||||
|
||||
return count_of_letters_to_process_for_date
|
||||
|
||||
|
||||
def notifications_not_yet_sent(should_be_sending_after_seconds, notification_type):
|
||||
older_than_date = datetime.utcnow() - timedelta(seconds=should_be_sending_after_seconds)
|
||||
|
||||
notifications = Notification.query.filter(
|
||||
Notification.created_at <= older_than_date,
|
||||
Notification.notification_type == notification_type,
|
||||
Notification.status == NOTIFICATION_CREATED
|
||||
).all()
|
||||
return notifications
|
||||
|
||||
Reference in New Issue
Block a user