X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=examples%2Ftypescript%2Fhttp-server-pool%2Ffastify-cluster%2Fsrc%2Fworker.ts;h=8f4442ed748d3fd2abc62c108d361aa6f565d2e6;hb=4e2f6ed03c2d68e2b3427cd0092656c75bcf69ad;hp=1551cb282ede3679ade624acb473a8ac2ab568c3;hpb=67f3f2d6cb8f915ec71f81c4533ab80a6c6a6f0f;p=poolifier.git diff --git a/examples/typescript/http-server-pool/fastify-cluster/src/worker.ts b/examples/typescript/http-server-pool/fastify-cluster/src/worker.ts index 1551cb28..8f4442ed 100644 --- a/examples/typescript/http-server-pool/fastify-cluster/src/worker.ts +++ b/examples/typescript/http-server-pool/fastify-cluster/src/worker.ts @@ -1,6 +1,8 @@ import type { AddressInfo } from 'node:net' -import { ClusterWorker } from 'poolifier' + import Fastify, { type FastifyInstance } from 'fastify' +import { ClusterWorker } from 'poolifier' + import type { WorkerData, WorkerResponse } from './types.js' class FastifyWorker extends ClusterWorker { @@ -36,7 +38,7 @@ class FastifyWorker extends ClusterWorker { await FastifyWorker.fastify.listen({ port }) return { status: true, - port: (FastifyWorker.fastify.server.address() as AddressInfo)?.port + port: (FastifyWorker.fastify.server.address() as AddressInfo).port } }