Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
private checkMessageWorkerId (message: MessageValue<Data | Response>): void {
if (message.workerId == null) {
throw new Error('Worker message received without worker id')
- } else if (
- message.workerId != null &&
- this.getWorkerNodeKeyByWorkerId(message.workerId) === -1
- ) {
+ } else if (this.getWorkerNodeKeyByWorkerId(message.workerId) === -1) {
throw new Error(
`Worker message received from unknown worker '${message.workerId}'`
)
private checkMessageWorkerId (message: MessageValue<Data>): void {
if (message.workerId == null) {
throw new Error('Message worker id is not set')
- } else if (message.workerId != null && message.workerId !== this.id) {
+ } else if (message.workerId !== this.id) {
throw new Error(
`Message worker id ${message.workerId} does not match the worker id ${this.id}`
)