From 9377f24b98f779e9cd054d80bd5430ca5c720dc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Crdeshmukh15=E2=80=9D?= <“rutuja.deshmukh@qlik.com”> Date: Wed, 6 Nov 2024 08:46:12 +0000 Subject: [PATCH] retry on ChunkedEncodingError --- tap_dixa/client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tap_dixa/client.py b/tap_dixa/client.py index 08901e8..1e4a779 100644 --- a/tap_dixa/client.py +++ b/tap_dixa/client.py @@ -3,6 +3,7 @@ import backoff import requests +from requests.exceptions import ChunkedEncodingError from tap_dixa.exceptions import (DixaClient429Error, DixaClient408Error, DixaClient5xxError, raise_for_error, retry_after_wait_gen) @@ -61,7 +62,7 @@ def _post(self, url, headers=None, params=None, data=None): return self._make_request(url, method="POST", headers=headers, params=params, data=data) # Added retry logic for 3 times when bad request or server error or rate limit happens - @backoff.on_exception(retry_after_wait_gen, (DixaClient429Error, DixaClient5xxError,DixaClient408Error), jitter=None, max_tries=3) + @backoff.on_exception(retry_after_wait_gen, (DixaClient429Error, DixaClient5xxError,DixaClient408Error, ChunkedEncodingError), jitter=None, max_tries=5) def _make_request(self, url, method, headers=None, params=None, data=None) -> dict: """ Makes the API request.