Browse Source

Fix choose_best_blocks()

Aleksandr Borzunov 3 năm trước cách đây
mục cha
commit
f3cf5f4d8d
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      src/server/block_selection.py

+ 1 - 1
src/server/block_selection.py

@@ -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))