From c2301b8e5ab9a84e16dd037c6f7e3e85030bb266 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sat, 22 Jul 2023 04:34:33 +0200 Subject: [PATCH] refactor: cleanup variables namespace MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/pools/cluster/fixed.ts | 4 ++-- src/pools/thread/fixed.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pools/cluster/fixed.ts b/src/pools/cluster/fixed.ts index 8e264359..522e7b67 100644 --- a/src/pools/cluster/fixed.ts +++ b/src/pools/cluster/fixed.ts @@ -64,7 +64,7 @@ export class FixedClusterPool< this.flushTasksQueue(workerNodeKey) // FIXME: wait for tasks to be finished const worker = this.workerNodes[workerNodeKey].worker - const workerExitPromise = new Promise(resolve => { + const waitWorkerExit = new Promise(resolve => { worker.on('exit', () => { resolve() }) @@ -74,7 +74,7 @@ export class FixedClusterPool< }) this.sendToWorker(workerNodeKey, { kill: true, workerId: worker.id }) worker.disconnect() - await workerExitPromise + await waitWorkerExit } /** @inheritDoc */ diff --git a/src/pools/thread/fixed.ts b/src/pools/thread/fixed.ts index a575d097..7199baf8 100644 --- a/src/pools/thread/fixed.ts +++ b/src/pools/thread/fixed.ts @@ -61,7 +61,7 @@ export class FixedThreadPool< // FIXME: wait for tasks to be finished const workerNode = this.workerNodes[workerNodeKey] const worker = workerNode.worker - const workerExitPromise = new Promise(resolve => { + const waitWorkerExit = new Promise(resolve => { worker.on('exit', () => { resolve() }) @@ -69,7 +69,7 @@ export class FixedThreadPool< this.sendToWorker(workerNodeKey, { kill: true, workerId: worker.threadId }) workerNode.closeChannel() await worker.terminate() - await workerExitPromise + await waitWorkerExit } /** @inheritDoc */ -- 2.34.1