Merge pull request #2397 from alphagov/slow-provider-switch

lower provider switch threshold from 20% to 30%
This commit is contained in:
Leo Hemsted
2019-03-14 16:22:52 +00:00
committed by GitHub

View File

@@ -97,7 +97,7 @@ def delete_invitations():
@statsd(namespace="tasks") @statsd(namespace="tasks")
def switch_current_sms_provider_on_slow_delivery(): def switch_current_sms_provider_on_slow_delivery():
""" """
Switch providers if at least 10% of notifications took more than four minutes to be delivered Switch providers if at least 30% of notifications took more than four minutes to be delivered
in the last ten minutes. Search from the time we last switched to the current provider. in the last ten minutes. Search from the time we last switched to the current provider.
""" """
current_provider = get_current_provider('sms') current_provider = get_current_provider('sms')
@@ -106,7 +106,7 @@ def switch_current_sms_provider_on_slow_delivery():
return return
slow_delivery_notifications = is_delivery_slow_for_provider( slow_delivery_notifications = is_delivery_slow_for_provider(
provider=current_provider.identifier, provider=current_provider.identifier,
threshold=0.2, threshold=0.3,
created_at=datetime.utcnow() - timedelta(minutes=10), created_at=datetime.utcnow() - timedelta(minutes=10),
delivery_time=timedelta(minutes=4), delivery_time=timedelta(minutes=4),
) )