Merge dependabot/npm_and_yarn/examples/typescript/smtp-client-pool/types/node-20...
[poolifier.git] / src / pools / thread / dynamic.ts
index 2a7d0149392a4295ec8e32717c68a84a140cef53..8e795512694aa41a2ea82b9c727e3ebd348b01c9 100644 (file)
@@ -34,14 +34,13 @@ export class DynamicThreadPool<
     super(min, filePath, opts, max)
     checkDynamicPoolSize(
       this.minimumNumberOfWorkers,
-      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
-      this.maximumNumberOfWorkers!
+      this.maximumNumberOfWorkers
     )
   }
 
   /** @inheritDoc */
   protected shallCreateDynamicWorker (): boolean {
-    return !this.full && this.internalBusy()
+    return (!this.full && this.internalBusy()) || this.empty
   }
 
   /** @inheritDoc */