From db2c739b6d6d8783c3c6c9905d9b5611e9c4893f Mon Sep 17 00:00:00 2001 From: Watchful1 Date: Mon, 16 Sep 2024 19:33:35 -0700 Subject: [PATCH] Longer sleeps --- personal/combine/merge_and_backfill.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/personal/combine/merge_and_backfill.py b/personal/combine/merge_and_backfill.py index 4a4b98e..80424d8 100644 --- a/personal/combine/merge_and_backfill.py +++ b/personal/combine/merge_and_backfill.py @@ -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)