From c8713742afc0a83b125ef86ad465d16630bf0436 Mon Sep 17 00:00:00 2001 From: Caleb Fontenot Date: Thu, 24 Feb 2022 13:56:04 -0600 Subject: [PATCH] Add HTTP 429 error handling --- parsers/modrinth.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parsers/modrinth.py b/parsers/modrinth.py index d9b5f46..5f9b2b5 100644 --- a/parsers/modrinth.py +++ b/parsers/modrinth.py @@ -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: