fix: fix dynamic pool with minimum # of workers set to zero
[poolifier.git] / src / pools / selection-strategies / worker-choice-strategy-context.ts
index 40e2e18f303122685c70eb09e824175ab5309cef..b7e0a4a7d8d80bc98d55a859cc241f1600bfd41f 100644 (file)
@@ -188,6 +188,9 @@ export class WorkerChoiceStrategyContext<
     let retriesCount = 0
     do {
       workerNodeKey = workerChoiceStrategy.choose()
+      if (workerNodeKey != null && workerNodeKey < 0) {
+        workerNodeKey = undefined
+      }
       if (workerNodeKey == null && chooseCount > 0) {
         retriesCount++
       }