Merge dependabot/npm_and_yarn/examples/typescript/websocket-server-pool/ws-worker_thr...
[poolifier.git] / examples / typescript / http-server-pool / fastify-worker_threads / src / fastify-poolifier.ts
index 15e5656b12abe44477a65dc7efd4a994b51663d7..85e22c12698cc8d3dbe2fb068c005e993ed8872f 100644 (file)
@@ -20,11 +20,12 @@ const fastifyPoolifierPlugin: FastifyPluginCallback<FastifyPoolifierOptions> = (
     },
     ...options
   }
+  const { workerFile, minWorkers, maxWorkers, ...poolOptions } = options
   const pool = new DynamicThreadPool<WorkerData, WorkerResponse>(
-    options.minWorkers as number,
-    options.maxWorkers as number,
-    options.workerFile,
-    options
+    minWorkers as number,
+    maxWorkers as number,
+    workerFile,
+    poolOptions
   )
   if (!fastify.hasDecorator('pool')) {
     fastify.decorate('pool', pool)