Restart tor connection pool when the tor port setting is changed
Otherwise the old port continued to be used until the program was restarted. Signed-off-by: Jesús <heckyel@hyperbola.info>
This commit is contained in:
parent
5df5e99213
commit
d0e3adab01
@ -71,6 +71,10 @@ class TorManager:
|
|||||||
'socks5h://127.0.0.1:' + str(settings.tor_port) + '/',
|
'socks5h://127.0.0.1:' + str(settings.tor_port) + '/',
|
||||||
cert_reqs='CERT_REQUIRED')
|
cert_reqs='CERT_REQUIRED')
|
||||||
self.tor_pool_refresh_time = time.monotonic()
|
self.tor_pool_refresh_time = time.monotonic()
|
||||||
|
settings.add_setting_changed_hook(
|
||||||
|
'tor_port',
|
||||||
|
lambda old_val, new_val: self.refresh_tor_connection_pool(),
|
||||||
|
)
|
||||||
|
|
||||||
self.new_identity_lock = gevent.lock.BoundedSemaphore(1)
|
self.new_identity_lock = gevent.lock.BoundedSemaphore(1)
|
||||||
self.last_new_identity_time = time.monotonic() - 20
|
self.last_new_identity_time = time.monotonic() - 20
|
||||||
|
Loading…
x
Reference in New Issue
Block a user