mirror of https://github.com/jumpserver/jumpserver
perf: 优化选择应用发布机
parent
932aed97d3
commit
3dc853c7f2
|
@ -162,7 +162,7 @@ class Applet(JMSBaseModel):
|
||||||
for host_id in using_host_ids.values():
|
for host_id in using_host_ids.values():
|
||||||
counts[host_id] += 1
|
counts[host_id] += 1
|
||||||
|
|
||||||
hosts = list(sorted(hosts, key=lambda h: counts[h.id]))
|
hosts = list(sorted(hosts, key=lambda h: counts[str(h.id)]))
|
||||||
return hosts[0]
|
return hosts[0]
|
||||||
|
|
||||||
def select_host(self, user, asset):
|
def select_host(self, user, asset):
|
||||||
|
|
Loading…
Reference in New Issue