Merge branch 'master' of github.com:poolifier/poolifier
[poolifier.git] / src / worker / abstract-worker.ts
index 349940faea20418b2bfa954561f7d258cc8ce3b2..4aad8e62669335c3940ba3fb88cc08afda062eb3 100644 (file)
@@ -10,7 +10,7 @@ const DEFAULT_MAX_INACTIVE_TIME = 1000 * 60
 const DEFAULT_KILL_BEHAVIOR: KillBehavior = KillBehaviors.SOFT
 
 /**
- * Base class containing some shared logic for all poolifier workers.
+ * Base class that implements some shared logic for all poolifier workers.
  *
  * @template MainWorker Type of main worker.
  * @template Data Type of data this worker receives from pool's execution. This can only be serializable data.
@@ -65,7 +65,7 @@ export abstract class AbstractWorker<
     this.checkWorkerOptions(this.opts)
     this.lastTaskTimestamp = Date.now()
     // Keep the worker active
-    if (!isMain) {
+    if (isMain === false) {
       this.aliveInterval = setInterval(
         this.checkAlive.bind(this),
         (this.opts.maxInactiveTime ?? DEFAULT_MAX_INACTIVE_TIME) / 2