X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=inline;f=src%2Fpools%2Fabstract-pool.ts;h=50ce2026d4f2e17f182f773227c2bc51f22de26f;hb=075e51d1065e974cf3080d61d0d9ceedf88313de;hp=b43d44a59eea1cb1c7990e660b96cb4cd5483a03;hpb=10e2aa7eed41bc326d02cf6055242768465ecdc5;p=poolifier.git diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index b43d44a5..50ce2026 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -84,6 +84,10 @@ export abstract class AbstractPool< Response > + /** + * Whether the pool is starting. + */ + private readonly starting: boolean /** * The start timestamp of the pool. */ @@ -128,6 +132,7 @@ export abstract class AbstractPool< this.setupHook() + this.starting = true while ( this.workerNodes.reduce( (accumulator, workerNode) => @@ -137,6 +142,7 @@ export abstract class AbstractPool< ) { this.createAndSetupWorker() } + this.starting = false this.startTimestamp = performance.now() } @@ -416,16 +422,6 @@ export abstract class AbstractPool< } } - private get starting (): boolean { - return ( - this.workerNodes.reduce( - (accumulator, workerNode) => - !workerNode.info.dynamic ? accumulator + 1 : accumulator, - 0 - ) < this.minSize - ) - } - private get ready (): boolean { return ( this.workerNodes.reduce(