fix: only pickup a free worker with dynamic pool if the worker selection
[poolifier.git] / src / pools / selection-strategies / less-busy-worker-choice-strategy.ts
index 87ee1ef88f16714d4271a5ba671686d122667f35..1d8bbaab5e8900af0187f0b938ab7c57b6d873b1 100644 (file)
@@ -33,7 +33,7 @@ export class LessBusyWorkerChoiceStrategy<
   /** {@inheritDoc} */
   public choose (): number {
     const freeWorkerKey = this.pool.findFreeWorkerKey()
-    if (!this.isDynamicPool && freeWorkerKey !== -1) {
+    if (freeWorkerKey !== -1) {
       return freeWorkerKey
     }
     let minRunTime = Infinity