mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 02:11:11 -05:00
Merge pull request #2255 from alphagov/switch_on_slow_goes_live
Switch providers on slow delivery goes live
This commit is contained in:
@@ -466,8 +466,13 @@ def is_delivery_slow_for_provider(
|
||||
|
||||
counts = {c[0]: c[1] for c in count}
|
||||
total_notifications = sum(counts.values())
|
||||
slow_notifications = counts.get(True, 0)
|
||||
|
||||
if total_notifications:
|
||||
return counts.get(True, 0) / total_notifications >= threshold
|
||||
current_app.logger.info("Slow delivery notifications count: {} out of {}. Ratio {}".format(
|
||||
slow_notifications, total_notifications, slow_notifications / total_notifications
|
||||
))
|
||||
return slow_notifications / total_notifications >= threshold
|
||||
else:
|
||||
return False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user