Skip to content

Commit

Permalink
Merge pull request #162 from descarteslabs/feat/retry-more
Browse files Browse the repository at this point in the history
Allow for additional response codes, and retry 429, 504.
  • Loading branch information
samskillman authored Aug 29, 2017
2 parents d09e265 + 593fcb2 commit e6680d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions descarteslabs/services/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def request(self, method, url, **kwargs):

resp = super(WrappedSession, self).request(method, self.base_url + url, **kwargs)

if resp.status_code == 200:
if resp.status_code >= 200 and resp.status_code < 400:
return resp
elif resp.status_code == 400:
raise BadRequestError(resp.text)
Expand All @@ -61,7 +61,7 @@ class Service:
'HEAD', 'TRACE', 'GET', 'POST',
'PUT', 'OPTIONS', 'DELETE'
]),
status_forcelist=[500, 502, 503])
status_forcelist=[500, 502, 503, 504])

ADAPTER = HTTPAdapter(max_retries=RETRY_CONFIG)

Expand Down

0 comments on commit e6680d1

Please sign in to comment.