X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fcluster%2Ffixed.ts;h=4a8cb4f1eeeafeb59adf1e30c5d678328cb19b70;hb=ecde6ea8c439bbdd9dc2ca118731b5006a1a9884;hp=e4cc7d6e232d30d0da85607ec87661a31892c2c9;hpb=1851fed0d7a9a5f5449797b01848dd44386c1517;p=poolifier.git diff --git a/src/pools/cluster/fixed.ts b/src/pools/cluster/fixed.ts index e4cc7d6e..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,10 +53,10 @@ 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) } /** @inheritDoc */