Benchmarks: properly parse env variables
[poolifier.git] / src / pools / abstract-pool.ts
index 40e06b158fe3af59ec49527a6cc170822520657f..346eb6d1fdb02cdf992f84b91502ae21f465800e 100644 (file)
@@ -85,7 +85,7 @@ export abstract class AbstractPool<
     public readonly filePath: string,
     public readonly opts: PoolOptions<Worker>
   ) {
-    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')
     }
   }