Merge dependabot/npm_and_yarn/examples/typescript/http-server-pool/fastify-hybrid...
[poolifier.git] / src / pools / thread / dynamic.ts
index 2fc360817d2b7bab3e634365b03ca9b541c76715..8e795512694aa41a2ea82b9c727e3ebd348b01c9 100644 (file)
@@ -34,13 +34,13 @@ export class DynamicThreadPool<
     super(min, filePath, opts, max)
     checkDynamicPoolSize(
       this.minimumNumberOfWorkers,
-      this.maximumNumberOfWorkers as number
+      this.maximumNumberOfWorkers
     )
   }
 
   /** @inheritDoc */
   protected shallCreateDynamicWorker (): boolean {
-    return !this.full && this.internalBusy()
+    return (!this.full && this.internalBusy()) || this.empty
   }
 
   /** @inheritDoc */