From: Jérôme Benoit Date: Wed, 13 Sep 2023 20:39:07 +0000 (+0200) Subject: refactor: cleanup workerId usage left X-Git-Tag: v2.7.0~1^2~36 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=e9dd5b668e17caa64fe1e3e17f481b36a42dffb3;p=poolifier.git refactor: cleanup workerId usage left Signed-off-by: Jérôme Benoit --- diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 6a26c7b7..eb517943 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -1248,8 +1248,7 @@ export abstract class AbstractPool< }) const workerInfo = this.getWorkerInfo(workerNodeKey) this.sendToWorker(workerNodeKey, { - checkActive: true, - workerId: workerInfo.id as number + checkActive: true }) if (this.taskFunctions.size > 0) { for (const [taskFunctionName, taskFunction] of this.taskFunctions) { diff --git a/src/pools/cluster/fixed.ts b/src/pools/cluster/fixed.ts index 20215df6..9470cccd 100644 --- a/src/pools/cluster/fixed.ts +++ b/src/pools/cluster/fixed.ts @@ -92,8 +92,7 @@ export class FixedClusterPool< /** @inheritDoc */ protected sendStartupMessageToWorker (workerNodeKey: number): void { this.sendToWorker(workerNodeKey, { - ready: false, - workerId: this.workerNodes[workerNodeKey].info.id as number + ready: false }) } diff --git a/src/pools/thread/fixed.ts b/src/pools/thread/fixed.ts index 51123204..2ad94a7b 100644 --- a/src/pools/thread/fixed.ts +++ b/src/pools/thread/fixed.ts @@ -90,10 +90,9 @@ export class FixedThreadPool< /** @inheritDoc */ protected sendStartupMessageToWorker (workerNodeKey: number): void { const workerNode = this.workerNodes[workerNodeKey] - const worker = workerNode.worker const port2: MessagePort = (workerNode.messageChannel as MessageChannel) .port2 - worker.postMessage( + workerNode.worker.postMessage( { ready: false, workerId: workerNode.info.id,