From: Jérôme Benoit Date: Fri, 16 Jun 2023 20:33:29 +0000 (+0200) Subject: refactor: cleanup variables namespace X-Git-Tag: v2.6.3~16 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=e8b3a5abad7d3ae4fa836ab0b76d54c1efd146e9;p=poolifier.git refactor: cleanup variables namespace Signed-off-by: Jérôme Benoit --- diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 13bc904a..1341c9af 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -717,17 +717,17 @@ export abstract class AbstractPool< protected createAndSetupDynamicWorker (): Worker { const worker = this.createAndSetupWorker() this.registerWorkerMessageListener(worker, message => { - const currentWorkerNodeKey = this.getWorkerNodeKey(worker) + const workerNodeKey = this.getWorkerNodeKey(worker) if ( isKillBehavior(KillBehaviors.HARD, message.kill) || (message.kill != null && ((this.opts.enableTasksQueue === false && - this.workerNodes[currentWorkerNodeKey].workerUsage.tasks - .executing === 0) || + this.workerNodes[workerNodeKey].workerUsage.tasks.executing === + 0) || (this.opts.enableTasksQueue === true && - this.workerNodes[currentWorkerNodeKey].workerUsage.tasks - .executing === 0 && - this.tasksQueueSize(currentWorkerNodeKey) === 0))) + this.workerNodes[workerNodeKey].workerUsage.tasks.executing === + 0 && + this.tasksQueueSize(workerNodeKey) === 0))) ) { // Kill message received from the worker: no new tasks are submitted to that worker for a while ( > maxInactiveTime) void (this.destroyWorker(worker) as Promise)