mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-15 04:39:58 +00:00
api/config: separate error if statements for session & instance count
This commit is contained in:
parent
541bf04575
commit
44e08e8474
1 changed files with 3 additions and 1 deletions
|
@ -62,7 +62,9 @@ export const isCluster = env.instanceCount > 1;
|
||||||
|
|
||||||
if (env.sessionEnabled && env.jwtSecret.length < 16) {
|
if (env.sessionEnabled && env.jwtSecret.length < 16) {
|
||||||
throw new Error("JWT_SECRET env is too short (must be at least 16 characters long)");
|
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");
|
throw new Error("API_REDIS_URL is required when API_INSTANCE_COUNT is >= 2");
|
||||||
} else if (env.instanceCount > 1 && !await supportsReusePort()) {
|
} 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');
|
console.error('API_INSTANCE_COUNT is not supported in your environment. to use this env, your node.js');
|
||||||
|
|
Loading…
Reference in a new issue