Add HTTP 429 error handling
This commit is contained in:
parent
fa419980f5
commit
7b195c4b6a
@ -24,7 +24,7 @@ def failCheck(response, functOrigin):
|
|||||||
if response.status_code == 429:
|
if response.status_code == 429:
|
||||||
print("Too many requests!")
|
print("Too many requests!")
|
||||||
time.sleep(int(response.headers["Retry-After"]))
|
time.sleep(int(response.headers["Retry-After"]))
|
||||||
print("Retrying "+functOrigin"...")
|
print("Retrying "+functOrigin+"...")
|
||||||
return True
|
return True
|
||||||
elif response.status_code != 200:
|
elif response.status_code != 200:
|
||||||
raise error
|
raise error
|
||||||
|
Loading…
x
Reference in New Issue
Block a user