From: Jérôme Benoit Date: Sat, 22 Jul 2023 02:34:33 +0000 (+0200) Subject: refactor: cleanup variables namespace X-Git-Tag: v2.6.21~42^2~1 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=c2301b8e5ab9a84e16dd037c6f7e3e85030bb266;p=poolifier.git refactor: cleanup variables namespace Signed-off-by: Jérôme Benoit --- 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 */