refactor: cleanup variables namespace
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 16 Jun 2023 20:33:29 +0000 (22:33 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 16 Jun 2023 20:33:29 +0000 (22:33 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/pools/abstract-pool.ts

index 13bc904a07bf12a02f1958991c53ef54a21889c2..1341c9afdd8b867faea351389a6f2792b21e7bc6 100644 (file)
@@ -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<void>)