X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=examples%2Ftypescript%2Fhttp-server-pool%2Ffastify-cluster%2Fsrc%2Fworker.ts;h=283a223e3438aa07af36343368d6dd03de05017e;hb=d71ff32b4fafa85847043054d1174efc6b9b391e;hp=eb546ef0a9d82c189d2ef5b799395321c7d8df62;hpb=ff6cf64964e78aafa95098852ec0472b567f7b1b;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 eb546ef0..283a223e 100644 --- a/examples/typescript/http-server-pool/fastify-cluster/src/worker.ts +++ b/examples/typescript/http-server-pool/fastify-cluster/src/worker.ts @@ -17,6 +17,7 @@ class FastifyWorker extends ClusterWorker { workerData?: WorkerData ): Promise => { const { port } = workerData as WorkerData + FastifyWorker.fastify = Fastify({ logger: true }) @@ -35,7 +36,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 } }