X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fpools%2Fcluster%2Ffixed.ts;h=6e9b4b07113bac62000a84ae0a2d8aa05b333532;hb=21f710aa73abbb5d90328cfb199adfc0f7a70406;hp=a88197f715bdd2c2a129638d3960dce9d9ac8420;hpb=6677a3d36e9e7241c54db7cd69daa40f52fcbcb3;p=poolifier.git diff --git a/src/pools/cluster/fixed.ts b/src/pools/cluster/fixed.ts index a88197f7..6e9b4b07 100644 --- a/src/pools/cluster/fixed.ts +++ b/src/pools/cluster/fixed.ts @@ -1,13 +1,8 @@ import cluster, { type ClusterSettings, type Worker } from 'node:cluster' import type { MessageValue } from '../../utility-types' import { AbstractPool } from '../abstract-pool' -import { - type PoolOptions, - type PoolType, - PoolTypes, - type WorkerType, - WorkerTypes -} from '../pool' +import { type PoolOptions, type PoolType, PoolTypes } from '../pool' +import { type WorkerType, WorkerTypes } from '../worker' /** * Options for a poolifier cluster pool. @@ -66,7 +61,7 @@ export class FixedClusterPool< /** @inheritDoc */ protected destroyWorker (worker: Worker): void { - this.sendToWorker(worker, { kill: 1 }) + this.sendToWorker(worker, { kill: true, workerId: worker.id }) worker.on('disconnect', () => { worker.kill() })