build(deps-dev): apply updates
[poolifier.git] / src / pools / selection-strategies / round-robin-worker-choice-strategy.ts
index 222a03495db53a789a0038e3ce9e0e41f0e17518..b023234a202cacc50b8f2505859e4e444bcf8f0f 100644 (file)
@@ -50,7 +50,9 @@ export class RoundRobinWorkerChoiceStrategy<
   /** @inheritDoc */
   public choose (): number {
     const chosenWorkerNodeKey = this.nextWorkerNodeKey
-    this.roundRobinNextWorkerNodeKey()
+    do {
+      this.roundRobinNextWorkerNodeKey()
+    } while (!this.isWorkerNodeReady(this.nextWorkerNodeKey))
     return chosenWorkerNodeKey
   }