X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fworker%2Fcluster-worker.ts;h=0fd9095625fa7ab6bf4bd9203cbf9b4e2ef03348;hb=5aa31a743fde300612ae89a242b809ae7db083ed;hp=1f9895d6e37b25a73911cd84f1c1f6f7404a98b8;hpb=71cad0b00456d2f7cf0987604062674ff19b44c4;p=poolifier.git diff --git a/src/worker/cluster-worker.ts b/src/worker/cluster-worker.ts index 1f9895d6..0fd90956 100644 --- a/src/worker/cluster-worker.ts +++ b/src/worker/cluster-worker.ts @@ -33,7 +33,7 @@ export class ClusterWorker< opts: WorkerOptions = {} ) { super( - 'worker-cluster-pool:poolifier', + 'poolifier:cluster-worker', cluster.isPrimary, cluster.worker as Worker, taskFunctions, @@ -48,14 +48,12 @@ export class ClusterWorker< this.getMainWorker().on('message', this.messageListener.bind(this)) this.sendToMainWorker({ ready: true, - taskFunctionNames: this.listTaskFunctionNames(), - workerId: this.id + taskFunctionNames: this.listTaskFunctionNames() }) } catch { this.sendToMainWorker({ ready: false, - taskFunctionNames: this.listTaskFunctionNames(), - 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 }) } }