proxywatchd: add safeguards against tor outage

This commit is contained in:
rofl0r
2019-01-08 16:06:01 +00:00
parent 6e4c45175e
commit bd1e85a883

View File

@@ -59,6 +59,12 @@ class WorkerJob():
err == rocksock.RS_E_HIT_TIMEOUT:
# proxy is not online, so don't waste time trying all possible protocols
break
elif fp == 0 and \
err == rocksock.RS_E_TARGET_CONN_REFUSED:
fail_inc = 0
if random.randint(0, (config.watchd.threads-1)/2) == 0:
_log("could not connect to proxy 0, sleep 5s", "ERROR")
time.sleep(5)
elif et == rocksock.RS_ET_GAI:
fail_inc = 0
_log("could not resolve connection target %s"%srv, "ERROR")