From 992dc568c2249b7034f4bc83b2b472924ab337df Mon Sep 17 00:00:00 2001 From: j Date: Fri, 18 Mar 2016 11:29:18 +0100 Subject: [PATCH] give tor a bit more time --- oml/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/oml/utils.py b/oml/utils.py index b4d68ec..a81cf7c 100644 --- a/oml/utils.py +++ b/oml/utils.py @@ -383,12 +383,13 @@ def can_connect_dns(host="8.8.8.8", port=53): import state try: sock = socks.socksocket(socket.AF_INET, socket.SOCK_STREAM, 6) - sock.settimeout(1) + sock.settimeout(2) socks_port = state.tor.socks_port if state.tor else 9150 sock.set_proxy(socks.SOCKS5, "localhost", socks_port, True) sock.connect((host, port)) return True except: + #logger.debug('failed to connect', exc_info=True) pass return False