X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fabstract-pool.ts;h=346eb6d1fdb02cdf992f84b91502ae21f465800e;hb=97c16550808cdcc2350561d6b369efdea3f5263d;hp=40e06b158fe3af59ec49527a6cc170822520657f;hpb=11df35903da6f581c45e8b42e1d4fbd342bddc3c;p=poolifier.git diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 40e06b15..346eb6d1 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -85,7 +85,7 @@ export abstract class AbstractPool< public readonly filePath: string, public readonly opts: PoolOptions ) { - if (!this.isMain()) { + if (this.isMain() === false) { throw new Error('Cannot start a pool from a worker!') } this.checkNumberOfWorkers(this.numberOfWorkers) @@ -97,7 +97,7 @@ export abstract class AbstractPool< this.createAndSetupWorker() } - if (this.opts.enableEvents) { + if (this.opts.enableEvents === true) { this.emitter = new PoolEmitter() } this.workerChoiceStrategyContext = new WorkerChoiceStrategyContext( @@ -380,7 +380,7 @@ export abstract class AbstractPool< } private checkAndEmitBusy (): void { - if (this.opts.enableEvents && this.busy) { + if (this.opts.enableEvents === true && this.busy === true) { this.emitter?.emit('busy') } }