Add HTTP 429 error handling

master
Chloe Fontenot 🏳️‍⚧️ 2022-02-24 13:32:59 +07:00
parent 7b195c4b6a
commit b9fb40a9f5
1 changed files with 1 additions and 1 deletions

@ -23,7 +23,7 @@ def failCheck(response, functOrigin):
print("Status Code is: "+str(response.status_code))
if response.status_code == 429:
print("Too many requests!")
time.sleep(int(response.headers["Retry-After"]))
time.sleep(15) # Wait 15 seconds
print("Retrying "+functOrigin+"...")
return True
elif response.status_code != 200: