Updated clear_worker
This commit is contained in:
+2
-5
@@ -13,12 +13,9 @@ clients = {} # {ip: {id: worker}}
|
||||
def clear_worker(worker, clients):
|
||||
ip = worker.src_addr[0]
|
||||
workers = clients.get(ip)
|
||||
if workers:
|
||||
try:
|
||||
assert worker.id in workers
|
||||
workers.pop(worker.id)
|
||||
except KeyError:
|
||||
pass
|
||||
else:
|
||||
|
||||
if not workers:
|
||||
clients.pop(ip)
|
||||
if not clients:
|
||||
|
||||
Reference in New Issue
Block a user