Skip to content

Commit

Permalink
SDK-383: Add retries to get calls in case of 500 Response (#292)
Browse files Browse the repository at this point in the history
(cherry picked from commit 99544a9)
  • Loading branch information
chattarajoy authored and Manzoor Husain committed Dec 11, 2019
1 parent 2266e96 commit 4292d8c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions qds_sdk/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ def __init__(self, auth, rest_url, skip_ssl_cert_check, reuse=True):
self.session_with_retries = requests.Session()
self.session_with_retries.mount('https://', MyAdapter(max_retries=3))

@retry((RetryWithDelay, requests.Timeout), tries=6, delay=30, backoff=2)
@retry((RetryWithDelay, requests.Timeout, ServerError), tries=6, delay=30, backoff=2)
def get_raw(self, path, params=None):
return self._api_call_raw("GET", path, params=params)

@retry((RetryWithDelay, requests.Timeout), tries=6, delay=30, backoff=2)
@retry((RetryWithDelay, requests.Timeout, ServerError), tries=6, delay=30, backoff=2)
def get(self, path, params=None):
return self._api_call("GET", path, params=params)

Expand Down

0 comments on commit 4292d8c

Please sign in to comment.