refactor: refine autocannon parameters
[poolifier.git] / src / pools / selection-strategies / fair-share-worker-choice-strategy.ts
index bc8f8b48746ebf185503455241e94d42e8600552..f293bbb7cbe00eacb8c5e1e0d30b0e670da5a3ed 100644 (file)
@@ -70,8 +70,7 @@ export class FairShareWorkerChoiceStrategy<
 
   /** @inheritDoc */
   public choose (): number | undefined {
-    const chosenWorkerNodeKey = this.fairShareNextWorkerNodeKey()
-    this.assignChosenWorkerNodeKey(chosenWorkerNodeKey)
+    this.nextWorkerNodeKey = this.fairShareNextWorkerNodeKey()
     return this.nextWorkerNodeKey
   }
 
@@ -90,10 +89,7 @@ export class FairShareWorkerChoiceStrategy<
       }
       const workerVirtualTaskEndTimestamp =
         this.workersVirtualTaskEndTimestamp[workerNodeKey]
-      if (
-        this.isWorkerNodeEligible(workerNodeKey) &&
-        workerVirtualTaskEndTimestamp < minWorkerVirtualTaskEndTimestamp
-      ) {
+      if (workerVirtualTaskEndTimestamp < minWorkerVirtualTaskEndTimestamp) {
         minWorkerVirtualTaskEndTimestamp = workerVirtualTaskEndTimestamp
         chosenWorkerNodeKey = workerNodeKey
       }