Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
this.flushTasksQueue(workerNodeKey)
// FIXME: wait for tasks to be finished
const worker = this.workerNodes[workerNodeKey].worker
- const workerExitPromise = new Promise<void>(resolve => {
+ const waitWorkerExit = new Promise<void>(resolve => {
worker.on('exit', () => {
resolve()
})
})
this.sendToWorker(workerNodeKey, { kill: true, workerId: worker.id })
worker.disconnect()
- await workerExitPromise
+ await waitWorkerExit
}
/** @inheritDoc */
// FIXME: wait for tasks to be finished
const workerNode = this.workerNodes[workerNodeKey]
const worker = workerNode.worker
- const workerExitPromise = new Promise<void>(resolve => {
+ const waitWorkerExit = new Promise<void>(resolve => {
worker.on('exit', () => {
resolve()
})
this.sendToWorker(workerNodeKey, { kill: true, workerId: worker.threadId })
workerNode.closeChannel()
await worker.terminate()
- await workerExitPromise
+ await waitWorkerExit
}
/** @inheritDoc */