Revert "Merge pull request #3123 from alphagov/retry-loop-fix"

This reverts commit 541a765811, reversing
changes made to 6a9ac654a6.
This commit is contained in:
Leo Hemsted
2021-02-08 11:01:33 +00:00
parent 33f93dfea2
commit 49e6ec1ead
3 changed files with 10 additions and 23 deletions

View File

@@ -28,8 +28,8 @@ def get_retry_delay(retry_count):
# 2 to the power of x. 1, 2, 4, 8, 16, 32, ...
delay = 2**retry_count
# never wait longer than 4 minutes
return min(delay, 240)
# never wait longer than 5 minutes
return min(delay, 300)
def check_provider_message_should_send(broadcast_event, provider):
@@ -51,15 +51,6 @@ def check_provider_message_should_send(broadcast_event, provider):
4. If you need to re-send this task off again, you'll need to run the following command on paas:
`send_broadcast_provider_message.apply_async(args=(broadcast_event_id, provider), queue=QueueNames.BROADCASTS)`
"""
current_provider_message = broadcast_event.get_provider_message(provider)
# if this is the first time a task is being executed, it won't have a provider message yet
if current_provider_message and current_provider_message.status == BroadcastProviderMessageStatus.TECHNICAL_FAILURE:
raise CBCProxyFatalException(
f'Cannot send broadcast_event {broadcast_event.id} ' +
f'to provider {provider}: ' +
f'It is already in status technical-failure'
)
if broadcast_event.transmitted_finishes_at < datetime.utcnow():
# TODO: This should be a different kind of exception to distinguish "We should know something went wrong, but
# no immediate action" from "We need to fix this immediately"