X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fworker%2Fabstract-worker.ts;h=2afd6f3486a1103347a258c575cece7773e3c4d3;hb=0e05c4dc968e27cf71ef2ab266feb57d9d1bade9;hp=8a38b4e576464ecb88078540cc8604d7b3ad323f;hpb=13dbc2200ead2f549e2c54b6c5906fdeead07def;p=poolifier.git diff --git a/src/worker/abstract-worker.ts b/src/worker/abstract-worker.ts index 8a38b4e5..2afd6f34 100644 --- a/src/worker/abstract-worker.ts +++ b/src/worker/abstract-worker.ts @@ -71,7 +71,10 @@ export abstract class AbstractWorker< super(type) this.checkWorkerOptions(this.opts) this.checkTaskFunctions(taskFunctions) - if (!this.isMain) { + if ( + !this.isMain && + (this.opts.maxInactiveTime ?? DEFAULT_MAX_INACTIVE_TIME) > 0 + ) { this.lastTaskTimestamp = performance.now() this.aliveInterval = setInterval( this.checkAlive.bind(this),