reduce connection timeout

This commit is contained in:
Roy Olav Purser 2021-05-11 15:14:48 +02:00
parent 482877e5c6
commit 9cf3f9a3f4
Signed by: roypur
GPG Key ID: E14D26A036F21656

View File

@ -176,7 +176,7 @@ class MainHandler(tornado.web.RequestHandler):
rand.shuffle(proxy_list)
for proxy_temp in proxy_list:
try:
resp = requests.head(src, allow_redirects=True, proxies=proxy_temp.req, timeout=1)
resp = requests.head(src, allow_redirects=True, proxies=proxy_temp.req, timeout=(0.1, 2.0))
if resp is not None:
src = resp.url
except Exception as e: