X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fcluster%2Fdynamic.ts;h=51d1cbeece56d374df9228cbee9dbdfed86f1989;hb=c3024c5998f1aa6c228c5db083e160b6fd967d7c;hp=311d5c9d9393157205d03e5029f5515d7ba9a46b;hpb=d35e571704515a8b729d3455e4784054f07c368f;p=poolifier.git diff --git a/src/pools/cluster/dynamic.ts b/src/pools/cluster/dynamic.ts index 311d5c9d..51d1cbee 100644 --- a/src/pools/cluster/dynamic.ts +++ b/src/pools/cluster/dynamic.ts @@ -1,5 +1,5 @@ -import { checkDynamicPoolSize } from '../utils.js' import { PoolEvents, type PoolType, PoolTypes } from '../pool.js' +import { checkDynamicPoolSize } from '../utils.js' import { type ClusterPoolOptions, FixedClusterPool } from './fixed.js' /** @@ -34,13 +34,13 @@ export class DynamicClusterPool< 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 */