X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fpools%2Fcluster%2Ffixed.ts;h=4a8cb4f1eeeafeb59adf1e30c5d678328cb19b70;hb=00773faaaac2b2599bdc66823796d0c38b165bde;hp=c60266e3d72b623fb9225dcc20882c064d29438c;hpb=fea198e84b17af4bd0f63cb2984447afbd1a7192;p=poolifier.git diff --git a/src/pools/cluster/fixed.ts b/src/pools/cluster/fixed.ts index c60266e3..4a8cb4f1 100644 --- a/src/pools/cluster/fixed.ts +++ b/src/pools/cluster/fixed.ts @@ -1,4 +1,5 @@ import cluster, { type Worker } from 'node:cluster' + import type { MessageValue } from '../../utility-types.js' import { AbstractPool } from '../abstract-pool.js' import { type PoolOptions, type PoolType, PoolTypes } from '../pool.js' @@ -52,7 +53,7 @@ export class FixedClusterPool< workerNodeKey: number, message: MessageValue ): void { - this.workerNodes[workerNodeKey].worker.send({ + this.workerNodes[workerNodeKey]?.worker.send({ ...message, workerId: this.getWorkerInfo(workerNodeKey)?.id } satisfies MessageValue)