Merge dependabot/npm_and_yarn/examples/typescript/http-server-pool/fastify-worker_thr...
[poolifier.git] / src / pools / cluster / dynamic.ts
index 7b2c37984ece0bff91021777653d90e6c3e5ccab..51d1cbeece56d374df9228cbee9dbdfed86f1989 100644 (file)
@@ -1,5 +1,5 @@
-import { checkDynamicPoolSize } from '../utils.js'
 import { PoolEvents, type PoolType, PoolTypes } from '../pool.js'
+import { checkDynamicPoolSize } from '../utils.js'
 import { type ClusterPoolOptions, FixedClusterPool } from './fixed.js'
 
 /**
@@ -40,10 +40,7 @@ export class DynamicClusterPool<
 
   /** @inheritDoc */
   protected shallCreateDynamicWorker (): boolean {
-    return (
-      (!this.full && this.internalBusy()) ||
-      (this.minimumNumberOfWorkers === 0 && this.workerNodes.length === 0)
-    )
+    return (!this.full && this.internalBusy()) || this.empty
   }
 
   /** @inheritDoc */