refactor: factor out worker node termination code
[poolifier.git] / src / pools / selection-strategies / interleaved-weighted-round-robin-worker-choice-strategy.ts
index b034cba1d08d69761b3c8f05fdedf395c4702c0a..eee39ec8d646da13324c7050e86afc33882fa22c 100644 (file)
@@ -105,6 +105,7 @@ export class InterleavedWeightedRoundRobinWorkerChoiceStrategy<
         const workerWeight =
           this.opts.weights?.[workerNodeKey] ?? this.defaultWorkerWeight
         if (
+          this.isWorkerNodeReady(workerNodeKey) &&
           workerWeight >= this.roundWeights[roundIndex] &&
           this.workerNodeVirtualTaskRunTime < workerWeight
         ) {