X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fworker%2Fcluster-worker.ts;h=201a516c56e1d8ab2a3d2d569c4d54d7f0fd484d;hb=4608939f425568da5553db1f5bf883d4cca18e02;hp=35899e794f5b373aa5bca3ec5b3dbe2d1f5cd4c3;hpb=a5d152043363ea21ec667205c88e0b9f2a6ff04e;p=poolifier.git diff --git a/src/worker/cluster-worker.ts b/src/worker/cluster-worker.ts index 35899e79..201a516c 100644 --- a/src/worker/cluster-worker.ts +++ b/src/worker/cluster-worker.ts @@ -45,17 +45,15 @@ export class ClusterWorker< protected handleReadyMessage (message: MessageValue): void { if (message.workerId === this.id && message.ready === false) { try { - this.getMainWorker()?.on('message', this.messageListener.bind(this)) + this.getMainWorker().on('message', this.messageListener.bind(this)) this.sendToMainWorker({ ready: true, - taskFunctions: this.listTaskFunctions(), - workerId: this.id + taskFunctionNames: this.listTaskFunctionNames() }) } catch { this.sendToMainWorker({ ready: false, - taskFunctions: this.listTaskFunctions(), - workerId: this.id + taskFunctionNames: this.listTaskFunctionNames() }) } } @@ -68,6 +66,6 @@ export class ClusterWorker< /** @inheritDoc */ protected sendToMainWorker (message: MessageValue): void { - this.getMainWorker().send(message) + this.getMainWorker().send({ ...message, workerId: this.id }) } }