repositories
/
poolifier.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0dc838e
)
fix: register worker message handler only once the worker is ready
author
Jérôme Benoit
<jerome.benoit@sap.com>
Thu, 20 Jul 2023 16:14:09 +0000
(18:14 +0200)
committer
Jérôme Benoit
<jerome.benoit@sap.com>
Thu, 20 Jul 2023 16:14:09 +0000
(18:14 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/worker/cluster-worker.ts
patch
|
blob
|
blame
|
history
diff --git
a/src/worker/cluster-worker.ts
b/src/worker/cluster-worker.ts
index 0e3bccd3a7c1dad88019f582e9d1cfe97be663cf..4c1e118789d53f7228e51a5b974b80575985705f 100644
(file)
--- a/
src/worker/cluster-worker.ts
+++ b/
src/worker/cluster-worker.ts
@@
-41,14
+41,12
@@
export class ClusterWorker<
taskFunctions,
opts
)
- if (!this.isMain) {
- this.getMainWorker()?.on('message', this.messageListener.bind(this))
- }
}
/** @inheritDoc */
protected handleReadyMessage (message: MessageValue<Data>): void {
if (!this.isMain && message.workerId === this.id && message.ready != null) {
+ this.getMainWorker()?.on('message', this.messageListener.bind(this))
this.sendToMainWorker({ ready: true, workerId: this.id })
}
}