Fix choose_best_blocks()

This commit is contained in:
Aleksandr Borzunov 2022-07-13 22:59:01 +00:00
parent 75856e4769
commit f3cf5f4d8d

View File

@ -12,7 +12,7 @@ def choose_best_blocks(num_blocks: int, remote_module_infos: List[Optional[Remot
throughputs.append(sum(server.throughput for server in module.servers.values()
if server.state != ServerState.OFFLINE))
options = [(throughputs[i:i + num_blocks], i)
options = [(sorted(throughputs[i:i + num_blocks]), i)
for i in range(0, len(throughputs) - num_blocks + 1)]
best_start = min(options)[1]
return list(range(best_start, best_start + num_blocks))