mirror of
https://github.com/c0de-archive/spotipy.git
synced 2024-11-05 07:27:47 +00:00
debugging retry logic
This commit is contained in:
parent
a7936b8351
commit
cf75879a15
@ -123,15 +123,15 @@ class Spotify(object):
|
|||||||
retries -= 1
|
retries -= 1
|
||||||
status = e.http_status
|
status = e.http_status
|
||||||
# 429 means we hit a rate limit, backoff
|
# 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:
|
if retries < 0:
|
||||||
raise
|
raise
|
||||||
else:
|
else:
|
||||||
if self.trace:
|
print ('retrying ...' + str(delay) + 'secs')
|
||||||
print ('retrying ...' + str(delay) + 'secs')
|
|
||||||
time.sleep(delay)
|
time.sleep(delay)
|
||||||
delay += 1
|
delay += 1
|
||||||
else:
|
else:
|
||||||
|
print ('http status:' + status)
|
||||||
raise
|
raise
|
||||||
|
|
||||||
def _post(self, url, args=None, payload=None, **kwargs):
|
def _post(self, url, args=None, payload=None, **kwargs):
|
||||||
|
Loading…
Reference in New Issue
Block a user