X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fselection-strategies%2Ffair-share-worker-choice-strategy.ts;h=fc4bd1fd4de4f281c8dbae20fcf3014ca0a5565f;hb=9fe8fd698590c2494dc6793cfd8c08026fe88a31;hp=094e9b02f438d711de40431288864a55982cf9cb;hpb=fce028d66b18a0e46571eb82457055fe3177d702;p=poolifier.git diff --git a/src/pools/selection-strategies/fair-share-worker-choice-strategy.ts b/src/pools/selection-strategies/fair-share-worker-choice-strategy.ts index 094e9b02..fc4bd1fd 100644 --- a/src/pools/selection-strategies/fair-share-worker-choice-strategy.ts +++ b/src/pools/selection-strategies/fair-share-worker-choice-strategy.ts @@ -84,15 +84,15 @@ export class FairShareWorkerChoiceStrategy< let minWorkerVirtualTaskEndTimestamp = Infinity let chosenWorkerNodeKey: number | undefined for (const [workerNodeKey] of this.pool.workerNodes.entries()) { + if (!this.isWorkerNodeEligible(workerNodeKey)) { + continue + } if (this.workersVirtualTaskEndTimestamp[workerNodeKey] == null) { this.computeWorkerVirtualTaskEndTimestamp(workerNodeKey) } const workerVirtualTaskEndTimestamp = this.workersVirtualTaskEndTimestamp[workerNodeKey] - if ( - this.isWorkerNodeEligible(workerNodeKey) && - workerVirtualTaskEndTimestamp < minWorkerVirtualTaskEndTimestamp - ) { + if (workerVirtualTaskEndTimestamp < minWorkerVirtualTaskEndTimestamp) { minWorkerVirtualTaskEndTimestamp = workerVirtualTaskEndTimestamp chosenWorkerNodeKey = workerNodeKey }