build: bump volta pnpm version
[poolifier.git] / src / pools / thread / dynamic.ts
index 836cae0b0615e1f74733e09f9f21b450bf15506b..8e795512694aa41a2ea82b9c727e3ebd348b01c9 100644 (file)
@@ -34,17 +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()) ||
-      (this.minimumNumberOfWorkers === 0 && this.workerNodes.length === 0)
-    )
+    return (!this.full && this.internalBusy()) || this.empty
   }
 
   /** @inheritDoc */