From 44e08e8474a420bd168a9a00d6b845356d97854b Mon Sep 17 00:00:00 2001 From: wukko Date: Sat, 2 Nov 2024 16:48:34 +0600 Subject: [PATCH] api/config: separate error if statements for session & instance count --- api/src/config.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/src/config.js b/api/src/config.js index 925b51df..191e8441 100644 --- a/api/src/config.js +++ b/api/src/config.js @@ -62,7 +62,9 @@ export const isCluster = env.instanceCount > 1; if (env.sessionEnabled && env.jwtSecret.length < 16) { throw new Error("JWT_SECRET env is too short (must be at least 16 characters long)"); -} else if (env.instanceCount > 1 && !env.redisURL) { +} + +if (env.instanceCount > 1 && !env.redisURL) { throw new Error("API_REDIS_URL is required when API_INSTANCE_COUNT is >= 2"); } else if (env.instanceCount > 1 && !await supportsReusePort()) { console.error('API_INSTANCE_COUNT is not supported in your environment. to use this env, your node.js');