From eb04c89182884b260b3322106dd8829696bab391 Mon Sep 17 00:00:00 2001 From: Keith Ellis Date: Tue, 31 Oct 2023 16:34:02 -0400 Subject: [PATCH 1/2] Add check to fix startup if CLUSTER_MODE is enable --- packages/server/src/environment.ts | 1 + packages/server/src/startup.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/server/src/environment.ts b/packages/server/src/environment.ts index a1701535ce..b0a35eedf5 100644 --- a/packages/server/src/environment.ts +++ b/packages/server/src/environment.ts @@ -32,6 +32,7 @@ const environment = { REDIS_PASSWORD: process.env.REDIS_PASSWORD, REDIS_CLUSTERED: process.env.REDIS_CLUSTERED, HTTP_MIGRATIONS: process.env.HTTP_MIGRATIONS, + CLUSTER_MODE: process.env.CLUSTER_MODE, API_REQ_LIMIT_PER_SEC: process.env.API_REQ_LIMIT_PER_SEC, GOOGLE_CLIENT_ID: process.env.GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET: process.env.GOOGLE_CLIENT_SECRET, diff --git a/packages/server/src/startup.ts b/packages/server/src/startup.ts index b4a287d2d4..fd07c5f530 100644 --- a/packages/server/src/startup.ts +++ b/packages/server/src/startup.ts @@ -58,7 +58,7 @@ export async function startup(app?: any, server?: any) { return } STARTUP_RAN = true - if (server) { + if (server && env.CLUSTER_MODE?.toLowerCase() !== "true") { console.log(`Budibase running on ${JSON.stringify(server.address())}`) env._set("PORT", server.address().port) } From 5f585a426dceb922e548b9f5cff43cb0d85b7288 Mon Sep 17 00:00:00 2001 From: kellis5137 Date: Thu, 2 Nov 2023 11:29:30 -0400 Subject: [PATCH 2/2] Update startup.ts to use simpler flag check --- packages/server/src/startup.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/startup.ts b/packages/server/src/startup.ts index fd07c5f530..82cb3502ef 100644 --- a/packages/server/src/startup.ts +++ b/packages/server/src/startup.ts @@ -58,7 +58,7 @@ export async function startup(app?: any, server?: any) { return } STARTUP_RAN = true - if (server && env.CLUSTER_MODE?.toLowerCase() !== "true") { + if (server && !env.CLUSTER_MODE) { console.log(`Budibase running on ${JSON.stringify(server.address())}`) env._set("PORT", server.address().port) }