20 sec timeout for listModified
This commit is contained in:
parent
da49981ecd
commit
09ad4133fb
1 changed files with 7 additions and 5 deletions
|
@ -289,11 +289,13 @@ class Site(object):
|
|||
if not peers_try or len(queried) >= 3: # Stop after 3 successful query
|
||||
break
|
||||
peer = peers_try.pop(0)
|
||||
if not peer.connection and len(queried) < 2:
|
||||
peer.connect() # Only open new connection if less than 2 queried already
|
||||
if not peer.connection or peer.connection.handshake.get("rev", 0) < 126:
|
||||
continue # Not compatible
|
||||
if config.verbose:
|
||||
self.log.debug("Try to get updates from: %s Left: %s" % (peer, peers_try))
|
||||
|
||||
res = None
|
||||
with gevent.Timeout(20, exception=False):
|
||||
res = peer.listModified(since)
|
||||
|
||||
if not res or "modified_files" not in res:
|
||||
continue # Failed query
|
||||
|
||||
|
|
Loading…
Reference in a new issue