retry service callbacks on 429

if we're served a 429, put the item on the retry queue and retry the
same as if the service returned a 5xx. 429 is commonly returned for rate
limit exceeding, and retrying on a delay is a typical response to that.
This commit is contained in:
Leo Hemsted
2021-07-13 16:09:17 +01:00
parent 719ba698e2
commit 2ad9a3a380
2 changed files with 8 additions and 4 deletions

View File

@@ -86,7 +86,7 @@ def _send_data_to_service_callback_api(self, data, service_callback_url, token,
e
)
)
if not isinstance(e, HTTPError) or e.response.status_code >= 500:
if not isinstance(e, HTTPError) or e.response.status_code >= 500 or e.response.status_code == 429:
try:
self.retry(queue=QueueNames.CALLBACKS_RETRY)
except self.MaxRetriesExceededError: