From 79742f47dc8417b24e255284a9165399e40757f5 Mon Sep 17 00:00:00 2001 From: Jesse Wierzbinski Date: Sun, 15 Jun 2025 02:28:02 +0200 Subject: [PATCH] chore(api): :fire: Remove clustering ability from API worker --- entrypoints/api/index.ts | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/entrypoints/api/index.ts b/entrypoints/api/index.ts index 7937ea79..0ebcafdc 100644 --- a/entrypoints/api/index.ts +++ b/entrypoints/api/index.ts @@ -1,4 +1,3 @@ -import cluster from "node:cluster"; import process from "node:process"; import { Youch } from "youch"; import { sentry } from "@/sentry"; @@ -16,13 +15,7 @@ process.on("uncaughtException", async (error) => { console.error(await youch.toANSI(error)); }); -if (cluster.isPrimary) { - for (let i = 0; i < Number(process.env.NUM_CPUS ?? 1); i++) { - cluster.fork(); - } +await import("~/entrypoints/api/setup.ts"); +sentry?.captureMessage("Server started", "info"); - await import("~/entrypoints/api/setup.ts"); - sentry?.captureMessage("Server started", "info"); -} else { - createServer(config, await appFactory()); -} +createServer(config, await appFactory());