fix: ensure worker node cannot be instantiaed without proper arguments
[poolifier.git] / src / pools / thread / dynamic.ts
index b03ca47e27ab272233338e8e4fb751bb8de0d0e4..a34f0c25f78b1da3a306c9c07edb5c5d43f0f21b 100644 (file)
@@ -31,6 +31,7 @@ export class DynamicThreadPool<
     opts: ThreadPoolOptions = {}
   ) {
     super(min, filePath, opts)
+    this.checkDynamicPoolSize(this.numberOfWorkers, this.max)
   }
 
   /** @inheritDoc */
@@ -38,11 +39,6 @@ export class DynamicThreadPool<
     return PoolTypes.dynamic
   }
 
-  /** @inheritDoc */
-  protected get maxSize (): number {
-    return this.max
-  }
-
   /** @inheritDoc */
   protected get busy (): boolean {
     return this.full && this.internalBusy()