Add HTTP 429 error handling
This commit is contained in:
parent
b9fb40a9f5
commit
c8713742af
@ -22,8 +22,8 @@ base_api_url = "https://api.modrinth.com:443/api/v1"
|
||||
def failCheck(response, functOrigin):
|
||||
print("Status Code is: "+str(response.status_code))
|
||||
if response.status_code == 429:
|
||||
print("Too many requests!")
|
||||
time.sleep(15) # Wait 15 seconds
|
||||
print("Too many requests!"+'\n'+"Waiting for 30 seconds...")
|
||||
time.sleep(30) # Wait 30 seconds
|
||||
print("Retrying "+functOrigin+"...")
|
||||
return True
|
||||
elif response.status_code != 200:
|
||||
|
Loading…
Reference in New Issue
Block a user