fix: fix pool sizing in examples
[poolifier.git] / examples / typescript / websocket-server-pool / ws-hybrid / src / main.ts
index b9e48bdd2ee194abf47d6d1b69eddd3dc134100d..5cfbbf43e36e3f6fe0595bd9c1256cc8bcbf6f3e 100644 (file)
@@ -21,7 +21,10 @@ const pool = new FixedClusterPool<ClusterWorkerData, ClusterWorkerResponse>(
       pool
         .execute({
           port: 8080,
-          maxWorkers: Math.round(availableParallelism() / 4),
+          maxWorkers:
+            Math.round(availableParallelism() / 4) < 1
+              ? 1
+              : Math.round(availableParallelism() / 4),
           workerFile: requestHandlerWorkerFile,
           enableTasksQueue: true,
           tasksQueueOptions: {