X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fworker%2Fcluster-worker.ts;h=26964aa489f83fff90f8e4306c3dc1bbafc36f23;hb=1c25f937c2fd468cf1363b360d8f87aceaae6e9a;hp=e5bcb72781680fdcd9c0a3a505ae587947e35609;hpb=f05ed93ccebb3ea4212d015788bcd6ca9e0b38d2;p=poolifier.git diff --git a/src/worker/cluster-worker.ts b/src/worker/cluster-worker.ts index e5bcb727..26964aa4 100644 --- a/src/worker/cluster-worker.ts +++ b/src/worker/cluster-worker.ts @@ -45,11 +45,18 @@ 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.sendTaskFunctionsListToMainWorker() - this.sendToMainWorker({ ready: true, workerId: this.id }) + this.getMainWorker().on('message', this.messageListener.bind(this)) + this.sendToMainWorker({ + ready: true, + taskFunctions: this.listTaskFunctions(), + workerId: this.id + }) } catch { - this.sendToMainWorker({ ready: false, workerId: this.id }) + this.sendToMainWorker({ + ready: false, + taskFunctions: this.listTaskFunctions(), + workerId: this.id + }) } } }