X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fselection-strategies%2Fleast-busy-worker-choice-strategy.ts;h=de71167ee8d307bf8c9b20f5f2df6fca7d9374c6;hb=aa1e0433fcfdc47175d6144524bcda57ab2947a1;hp=224ca540130f49c37e6b28d5de471e5237dddb14;hpb=a25c335d7e5573a171fc96c445cb6092852b2c4a;p=poolifier.git diff --git a/src/pools/selection-strategies/least-busy-worker-choice-strategy.ts b/src/pools/selection-strategies/least-busy-worker-choice-strategy.ts index 224ca540..de71167e 100644 --- a/src/pools/selection-strategies/least-busy-worker-choice-strategy.ts +++ b/src/pools/selection-strategies/least-busy-worker-choice-strategy.ts @@ -61,8 +61,7 @@ export class LeastBusyWorkerChoiceStrategy< /** @inheritDoc */ public choose (): number | undefined { - const chosenWorkerNodeKey = this.leastBusyNextWorkerNodeKey() - this.assignChosenWorkerNodeKey(chosenWorkerNodeKey) + this.nextWorkerNodeKey = this.leastBusyNextWorkerNodeKey() return this.nextWorkerNodeKey } @@ -78,13 +77,10 @@ export class LeastBusyWorkerChoiceStrategy< const workerTime = (workerNode.usage.runTime?.aggregate ?? 0) + (workerNode.usage.waitTime?.aggregate ?? 0) - if (this.isWorkerNodeEligible(workerNodeKey) && workerTime === 0) { + if (workerTime === 0) { chosenWorkerNodeKey = workerNodeKey break - } else if ( - this.isWorkerNodeEligible(workerNodeKey) && - workerTime < minTime - ) { + } else if (workerTime < minTime) { minTime = workerTime chosenWorkerNodeKey = workerNodeKey }