mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-27 02:41:23 -05:00
Merge pull request #2373 from alphagov/slow-provider-threshold
move slow sms provider threshold from 10% to 20%
This commit is contained in:
@@ -106,7 +106,7 @@ def switch_current_sms_provider_on_slow_delivery():
|
||||
return
|
||||
slow_delivery_notifications = is_delivery_slow_for_provider(
|
||||
provider=current_provider.identifier,
|
||||
threshold=0.1,
|
||||
threshold=0.2,
|
||||
created_at=datetime.utcnow() - timedelta(minutes=10),
|
||||
delivery_time=timedelta(minutes=4),
|
||||
)
|
||||
|
||||
@@ -494,8 +494,8 @@ def is_delivery_slow_for_provider(
|
||||
slow_notifications = counts.get(True, 0)
|
||||
|
||||
if total_notifications:
|
||||
current_app.logger.info("Slow delivery notifications count: {} out of {}. Ratio {}".format(
|
||||
slow_notifications, total_notifications, slow_notifications / total_notifications
|
||||
current_app.logger.info("Slow delivery notifications count for provider {}: {} out of {}. Ratio {}".format(
|
||||
provider, slow_notifications, total_notifications, slow_notifications / total_notifications
|
||||
))
|
||||
return slow_notifications / total_notifications >= threshold
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user