TorMgr: Change new identity cooldown to 7 seconds instead of 6

Because sometimes a new identity was not being respected

Signed-off-by: Jesús <heckyel@hyperbola.info>
This commit is contained in:
James Taylor 2021-02-10 12:30:56 -08:00 committed by Jesús
parent 1cc0ffcb20
commit 4a8ba594d1
No known key found for this signature in database
GPG Key ID: F6EE7BC59A315766

View File

@ -61,9 +61,9 @@ connection_pool = urllib3.PoolManager(cert_reqs='CERT_REQUIRED')
class TorManager:
MAX_TRIES = 3
# Remember the 6-sec wait times, so make cooldown be two of those
# Remember the 7-sec wait times, so make cooldown be two of those
# (otherwise it will retry forever if 429s never end)
COOLDOWN_TIME = 12
COOLDOWN_TIME = 14
def __init__(self):
self.old_tor_connection_pool = None
@ -150,8 +150,8 @@ class TorManager:
# be a new IP, based on experiments.
# Not necessary after first new identity
if original_try_num > 1:
print('Sleeping for 6 seconds before retrying request')
time.sleep(6) # experimentally determined minimum
print('Sleeping for 7 seconds before retrying request')
time.sleep(7) # experimentally determined minimum
return None
finally: