debugging retry logic

This commit is contained in:
Paul Lamere 2015-04-28 06:38:35 -04:00
parent a7936b8351
commit cf75879a15
1 changed files with 3 additions and 3 deletions

View File

@ -123,15 +123,15 @@ class Spotify(object):
retries -= 1
status = e.http_status
# 429 means we hit a rate limit, backoff
if status == 429 or status >= 500 and status < 600:
if status == 429 or (status >= 500 and status < 600):
if retries < 0:
raise
else:
if self.trace:
print ('retrying ...' + str(delay) + 'secs')
print ('retrying ...' + str(delay) + 'secs')
time.sleep(delay)
delay += 1
else:
print ('http status:' + status)
raise
def _post(self, url, args=None, payload=None, **kwargs):