repositories
/
e-mobility-charging-stations-simulator.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix: ensure worket set stop event is emitted once
[e-mobility-charging-stations-simulator.git]
/
src
/
worker
/
WorkerSet.ts
diff --git
a/src/worker/WorkerSet.ts
b/src/worker/WorkerSet.ts
index f1ab1cf5482efaadd25398aa7dfe0ae521d68912..f10ca9c8ce0f4fbfbd58a10faf0f44ab6073b20a 100644
(file)
--- a/
src/worker/WorkerSet.ts
+++ b/
src/worker/WorkerSet.ts
@@
-52,6
+52,7
@@
export class WorkerSet extends WorkerAbstract<WorkerData> {
version: workerSetVersion,
type: 'set',
worker: 'thread',
version: workerSetVersion,
type: 'set',
worker: 'thread',
+ started: this.started,
size: this.size,
elementsExecuting: [...this.workerSet].reduce(
(accumulator, workerSetElement) => accumulator + workerSetElement.numberOfWorkerElements,
size: this.size,
elementsExecuting: [...this.workerSet].reduce(
(accumulator, workerSetElement) => accumulator + workerSetElement.numberOfWorkerElements,
@@
-93,11
+94,11
@@
export class WorkerSet extends WorkerAbstract<WorkerData> {
})
await worker.terminate()
await waitWorkerExit
})
await worker.terminate()
await waitWorkerExit
- this.emitter?.emit(WorkerSetEvents.stopped, this.info)
- this.emitter?.emitDestroy()
- this.emitter?.removeAllListeners()
- this.started = false
}
}
+ this.emitter?.emit(WorkerSetEvents.stopped, this.info)
+ this.emitter?.emitDestroy()
+ this.emitter?.removeAllListeners()
+ this.started = false
}
/** @inheritDoc */
}
/** @inheritDoc */