Prefer connected workers
This commit is contained in:
parent
6fb9c6ef05
commit
ab2fe909f0
1 changed files with 1 additions and 1 deletions
|
@ -183,7 +183,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 else 9999)
|
||||
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)
|
||||
|
||||
for peer in peers: # One worker for every peer
|
||||
if peers and peer not in peers:
|
||||
|
|
Loading…
Reference in a new issue