From: Jérôme Benoit Date: Tue, 27 Jun 2023 15:55:22 +0000 (+0200) Subject: Merge branch 'master' of github.com:poolifier/poolifier X-Git-Tag: v2.6.6~20 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=d5d8ef5b0645ff2e43010f981a768c48cd559854;hp=a6d9dccfaf39e185c896747260d668fcb683a8ed;p=poolifier.git Merge branch 'master' of github.com:poolifier/poolifier --- diff --git a/CHANGELOG.md b/CHANGELOG.md index dba4ff69..49f72b43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- Ensure message handler is only registered in worker. + ## [2.6.5] - 2023-06-27 ### Known issues diff --git a/src/worker/abstract-worker.ts b/src/worker/abstract-worker.ts index f42f2c47..25be4820 100644 --- a/src/worker/abstract-worker.ts +++ b/src/worker/abstract-worker.ts @@ -90,8 +90,8 @@ export abstract class AbstractWorker< (this.opts.maxInactiveTime ?? DEFAULT_MAX_INACTIVE_TIME) / 2 ) this.checkAlive.bind(this)() + this.mainWorker?.on('message', this.messageListener.bind(this)) } - this.mainWorker?.on('message', this.messageListener.bind(this)) } private checkWorkerOptions (opts: WorkerOptions): void {