outgoing webhook: Don't retry on 50x response.

This reverts one retry case introduced in 53a8b2a.
This commit is contained in:
Robert Hönig
2017-09-25 16:49:28 +02:00
committed by Tim Abbott
parent 6a7d34316c
commit ba598def0b

View File

@@ -240,13 +240,9 @@ def do_rest_call(rest_operation, request_data, event, service_handler, timeout=N
% {'message_url': get_message_url(event, request_data),
'status_code': response.status_code,
'response': response.content})
# On 50x errors, try retry
if str(response.status_code).startswith('5'):
request_retry(event, request_data, "Internal Server error at third party.")
else:
failure_message = "Third party responded with %d" % (response.status_code)
fail_with_message(event, failure_message)
notify_bot_owner(event, request_data, response.status_code, response.content)
failure_message = "Third party responded with %d" % (response.status_code)
fail_with_message(event, failure_message)
notify_bot_owner(event, request_data, response.status_code, response.content)
except requests.exceptions.Timeout:
logging.info("Trigger event %s on %s timed out. Retrying" % (event["command"], event['service_name']))