mirror of
https://github.com/Watchful1/PushshiftDumps.git
synced 2025-12-20 18:45:45 -05:00
Add ratelimit retries
This commit is contained in:
parent
c848480ed9
commit
a9b75717e5
1 changed files with 1 additions and 1 deletions
|
|
@ -133,7 +133,7 @@ def query_reddit(ids, reddit, object_type):
|
|||
try:
|
||||
response = reddit.request(method="GET", path=endpoints.API_PATH["info"], params={"id": id_string})
|
||||
break
|
||||
except (prawcore.exceptions.ServerError, prawcore.exceptions.RequestException) as err:
|
||||
except (prawcore.exceptions.ServerError, prawcore.exceptions.RequestException, prawcore.exceptions.TooManyRequests) as err:
|
||||
log.info(f"No response from reddit api for {object_type}, sleeping {i * 5} seconds: {err} : {id_string}")
|
||||
time.sleep(i * 5)
|
||||
if response is None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue