repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge dependabot/npm_and_yarn/examples/typescript/http-server-pool/fastify-hybrid...
[poolifier.git]
/
examples
/
typescript
/
http-server-pool
/
fastify-cluster
/
src
/
worker.ts
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 3f7b3661f99cd2f51082366eadfc8cbe17ba804a..d70b76dd7f93f2d026126ef7b84b46504f2361bd 100644
(file)
--- 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, WorkerResponse> {
workerData?: WorkerData
): Promise<WorkerResponse> => {
const { port } = workerData as WorkerData
workerData?: WorkerData
): Promise<WorkerResponse> => {
const { port } = workerData as WorkerData
+
FastifyWorker.fastify = Fastify({
logger: true
})
FastifyWorker.fastify = Fastify({
logger: true
})
@@
-40,7
+41,11
@@
class FastifyWorker extends ClusterWorker<WorkerData, WorkerResponse> {
}
public constructor () {
}
public constructor () {
- super(FastifyWorker.startFastify)
+ super(FastifyWorker.startFastify, {
+ killHandler: async () => {
+ await FastifyWorker.fastify.close()
+ }
+ })
}
}
}
}