X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fthread%2Fdynamic.ts;h=8e795512694aa41a2ea82b9c727e3ebd348b01c9;hb=98f60ddd83d32e108adcfddebeb902f0d5a197eb;hp=836cae0b0615e1f74733e09f9f21b450bf15506b;hpb=e44639e9af74427b71f1556ff7ec9f7606373e0d;p=poolifier.git diff --git a/src/pools/thread/dynamic.ts b/src/pools/thread/dynamic.ts index 836cae0b..8e795512 100644 --- a/src/pools/thread/dynamic.ts +++ b/src/pools/thread/dynamic.ts @@ -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 */