Rev4003, Fix peer sorting if no ping delay yet
This commit is contained in:
parent
e1394d7a7d
commit
82c55ba038
2 changed files with 2 additions and 2 deletions
|
@ -13,7 +13,7 @@ class Config(object):
|
|||
|
||||
def __init__(self, argv):
|
||||
self.version = "0.7.0"
|
||||
self.rev = 4001
|
||||
self.rev = 4003
|
||||
self.argv = argv
|
||||
self.action = None
|
||||
self.pending_changes = {}
|
||||
|
|
|
@ -193,7 +193,7 @@ class WorkerManager(object):
|
|||
peers = list(peers)
|
||||
|
||||
# Sort by ping
|
||||
peers.sort(key=lambda peer: peer.connection.last_ping_delay if peer.connection and len(peer.connection.waiting_requests) == 0 and peer.connection.connected else 9999)
|
||||
peers.sort(key=lambda peer: peer.connection.last_ping_delay if peer.connection and peer.connection.last_ping_delay and len(peer.connection.waiting_requests) == 0 and peer.connection.connected else 9999)
|
||||
|
||||
for peer in peers: # One worker for every peer
|
||||
if peers and peer not in peers:
|
||||
|
|
Loading…
Reference in a new issue