mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 17:31:14 -05:00
Only loop timeout task if there's more work
Previously this would repeat the task even the current iteration of the loop had processed a non-full batch. This could cause the task to error incorrectly if one or two notifications breach the timeout threshold in between iterations.
This commit is contained in:
@@ -155,7 +155,7 @@ def timeout_notifications():
|
|||||||
len(technical_failure_notifications), [str(x.id) for x in technical_failure_notifications])
|
len(technical_failure_notifications), [str(x.id) for x in technical_failure_notifications])
|
||||||
raise NotificationTechnicalFailureException(message)
|
raise NotificationTechnicalFailureException(message)
|
||||||
|
|
||||||
if len(notifications) == 0:
|
if len(notifications) < 100000:
|
||||||
return
|
return
|
||||||
|
|
||||||
raise RuntimeError("Some notifications may still be in sending.")
|
raise RuntimeError("Some notifications may still be in sending.")
|
||||||
|
|||||||
Reference in New Issue
Block a user