Longer sleeps

This commit is contained in:
Watchful1 2024-09-16 19:33:35 -07:00
parent ed12d9c4ca
commit db2c739b6d

View file

@ -89,7 +89,7 @@ def query_pushshift(ids, bearer, object_type, pushshift_token_function):
'User-Agent': "In script by /u/Watchful1",
'Authorization': f"Bearer {bearer}"}, timeout=15)
except (requests.exceptions.ConnectionError, requests.exceptions.ReadTimeout):
time.sleep(2)
time.sleep(4 * i)
continue
if response is None:
continue
@ -100,7 +100,7 @@ def query_pushshift(ids, bearer, object_type, pushshift_token_function):
log.warning(url)
log.warning(f"'Authorization': Bearer {bearer}")
bearer = pushshift_token_function(bearer)
time.sleep(2)
time.sleep(4 * i)
if response is None:
log.warning(f"4 requests failed with no response")
log.warning(url)