X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fselection-strategies%2Finterleaved-weighted-round-robin-worker-choice-strategy.ts;h=e37543820593a68b6860e7b597c40919c8866e9d;hb=b9da9d7e74c720f83482a09d1b883fc83d04f4ed;hp=86a7f5ca8f801c6b5e98dc380e9ee5dea80d37e3;hpb=8db00db4ef10ceeb63dcbd7a85be68b9a70e5911;p=poolifier.git diff --git a/src/pools/selection-strategies/interleaved-weighted-round-robin-worker-choice-strategy.ts b/src/pools/selection-strategies/interleaved-weighted-round-robin-worker-choice-strategy.ts index 86a7f5ca..e3754382 100644 --- a/src/pools/selection-strategies/interleaved-weighted-round-robin-worker-choice-strategy.ts +++ b/src/pools/selection-strategies/interleaved-weighted-round-robin-worker-choice-strategy.ts @@ -74,12 +74,12 @@ export class InterleavedWeightedRoundRobinWorkerChoiceStrategy< workerNodeKey < this.pool.workerNodes.length; workerNodeKey++ ) { + if (!this.isWorkerNodeEligible(workerNodeKey)) { + continue + } const workerWeight = this.opts.weights?.[workerNodeKey] ?? this.defaultWorkerWeight - if ( - this.isWorkerNodeEligible(workerNodeKey) && - workerWeight >= this.roundWeights[roundIndex] - ) { + if (workerWeight >= this.roundWeights[roundIndex]) { workerNodeId = workerNodeKey break }