mirror of
https://github.com/c0de-archive/spotipy.git
synced 2025-01-06 14:52:50 +00:00
Adjusted retry sleep backoff
This commit is contained in:
parent
6261eae0e2
commit
7499d8e511
@ -156,7 +156,7 @@ class Spotify(object):
|
|||||||
else:
|
else:
|
||||||
sleep_seconds = int(e.headers.get('Retry-After', delay))
|
sleep_seconds = int(e.headers.get('Retry-After', delay))
|
||||||
print ('retrying ...' + str(sleep_seconds) + 'secs')
|
print ('retrying ...' + str(sleep_seconds) + 'secs')
|
||||||
time.sleep(sleep_seconds)
|
time.sleep(sleep_seconds + 1)
|
||||||
delay += 1
|
delay += 1
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
@ -169,7 +169,7 @@ class Spotify(object):
|
|||||||
if retries >= 0:
|
if retries >= 0:
|
||||||
sleep_seconds = int(e.headers.get('Retry-After', delay))
|
sleep_seconds = int(e.headers.get('Retry-After', delay))
|
||||||
print ('retrying ...' + str(delay) + 'secs')
|
print ('retrying ...' + str(delay) + 'secs')
|
||||||
time.sleep(sleep_seconds)
|
time.sleep(sleep_seconds + 1)
|
||||||
delay += 1
|
delay += 1
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
|
Loading…
Reference in New Issue
Block a user