Merge branch 'master' into combined-prs-branch
[poolifier.git] / examples / typescript / http-server-pool / fastify-worker_threads / src / main.ts
index 7db0b5196d973b98b51e6ac37dea5d12af9bbbf1..5610bc1d48bbadf0edee7b87b710d9feb5066d48 100644 (file)
@@ -1,6 +1,9 @@
 import { dirname, extname, join } from 'node:path'
+import { exit } from 'node:process'
 import { fileURLToPath } from 'node:url'
+
 import Fastify from 'fastify'
+
 import { fastifyPoolifier } from './fastify-poolifier.js'
 
 /**
@@ -24,7 +27,7 @@ await fastify.register(fastifyPoolifier, {
     concurrency: 8
   },
   errorHandler: (e: Error) => {
-    fastify.log.error(e)
+    fastify.log.error('Thread worker error:', e)
   }
 })
 
@@ -43,5 +46,5 @@ try {
   await fastify.listen({ port })
 } catch (err) {
   fastify.log.error(err)
-  process.exit(1)
+  exit(1)
 }