increase timeout
This commit is contained in:
parent
10330c8ca8
commit
03c24396e0
2 changed files with 4 additions and 3 deletions
|
@ -42,7 +42,8 @@ def can_connect(data):
|
|||
c = r.read()
|
||||
return True
|
||||
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
|
||||
|
||||
class LocalNodesBase(Thread):
|
||||
|
|
|
@ -100,7 +100,7 @@ class Node(Thread):
|
|||
return url
|
||||
|
||||
def resolve(self):
|
||||
logger.debug('resolve node')
|
||||
#logger.debug('resolve node %s', self.user_id)
|
||||
r = self.get_local()
|
||||
if r:
|
||||
self.local = r['host']
|
||||
|
@ -225,7 +225,7 @@ class Node(Thread):
|
|||
'Accept-Encoding': 'gzip',
|
||||
}
|
||||
self._opener.addheaders = list(zip(headers.keys(), headers.values()))
|
||||
self._opener.timeout = 1
|
||||
self._opener.timeout = 2
|
||||
r = self._opener.open(url)
|
||||
version = r.headers.get('X-Node-Protocol', None)
|
||||
if version != settings.NODE_PROTOCOL:
|
||||
|
|
Loading…
Reference in a new issue