X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fcluster%2Ffixed.ts;h=75c0853586c21739ff217eb3be4e63c64e7bb271;hb=facb41d7d33bd6c11970da5e946c51347824fd54;hp=c7c95c4b3dad537b39dfd44d37481178035fcb4c;hpb=85bb5e488cb5adb8fef806e1f3fd9f85c525713e;p=poolifier.git diff --git a/src/pools/cluster/fixed.ts b/src/pools/cluster/fixed.ts index c7c95c4b..75c08535 100644 --- a/src/pools/cluster/fixed.ts +++ b/src/pools/cluster/fixed.ts @@ -63,7 +63,8 @@ export class FixedClusterPool< protected async destroyWorkerNode (workerNodeKey: number): Promise { this.flushTasksQueue(workerNodeKey) // FIXME: wait for tasks to be finished - const worker = this.workerNodes[workerNodeKey].worker + const workerNode = this.workerNodes[workerNodeKey] + const worker = workerNode.worker const waitWorkerExit = new Promise((resolve) => { worker.on('exit', () => { resolve() @@ -72,7 +73,10 @@ export class FixedClusterPool< worker.on('disconnect', () => { worker.kill() }) - await this.sendKillMessageToWorker(workerNodeKey, worker.id) + await this.sendKillMessageToWorker( + workerNodeKey, + workerNode.info.id as number + ) worker.disconnect() await waitWorkerExit } @@ -89,7 +93,7 @@ export class FixedClusterPool< protected sendStartupMessageToWorker (workerNodeKey: number): void { this.sendToWorker(workerNodeKey, { ready: false, - workerId: this.workerNodes[workerNodeKey].worker.id + workerId: this.workerNodes[workerNodeKey].info.id as number }) }