increase timeout

This commit is contained in:
j 2015-12-01 11:51:58 +01:00
parent 10330c8ca8
commit 03c24396e0
2 changed files with 4 additions and 3 deletions

View file

@ -42,7 +42,8 @@ def can_connect(data):
c = r.read() c = r.read()
return True return True
except: except:
logger.debug('failed to connect to local node %s', data, exc_info=1) pass
#logger.debug('failed to connect to local node %s', data, exc_info=1)
return False return False
class LocalNodesBase(Thread): class LocalNodesBase(Thread):

View file

@ -100,7 +100,7 @@ class Node(Thread):
return url return url
def resolve(self): def resolve(self):
logger.debug('resolve node') #logger.debug('resolve node %s', self.user_id)
r = self.get_local() r = self.get_local()
if r: if r:
self.local = r['host'] self.local = r['host']
@ -225,7 +225,7 @@ class Node(Thread):
'Accept-Encoding': 'gzip', 'Accept-Encoding': 'gzip',
} }
self._opener.addheaders = list(zip(headers.keys(), headers.values())) self._opener.addheaders = list(zip(headers.keys(), headers.values()))
self._opener.timeout = 1 self._opener.timeout = 2
r = self._opener.open(url) r = self._opener.open(url)
version = r.headers.get('X-Node-Protocol', None) version = r.headers.get('X-Node-Protocol', None)
if version != settings.NODE_PROTOCOL: if version != settings.NODE_PROTOCOL: