Merge branch 'master' of github.com:jerome-benoit/poolifier
[poolifier.git] / src / pools / selection-strategies / interleaved-weighted-round-robin-worker-choice-strategy.ts
index 78960f1063c81f1c616d8fb9b868061cdc6598c5..26f9d909eed84f448e0244042d23dc289a26b96a 100644 (file)
@@ -80,7 +80,10 @@ export class InterleavedWeightedRoundRobinWorkerChoiceStrategy<
       ) {
         const workerWeight =
           this.opts.weights?.[workerNodeKey] ?? this.defaultWorkerWeight
-        if (workerWeight >= this.roundWeights[roundIndex]) {
+        if (
+          this.isWorkerNodeReady(workerNodeKey) &&
+          workerWeight >= this.roundWeights[roundIndex]
+        ) {
           roundId = roundIndex
           workerNodeId = workerNodeKey
           break