mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-10-26 10:42:52 +01:00
update mongoose options
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
"LOGGLY_SUBDOMAIN": "example-subdomain",
|
||||
"LOGGLY_TOKEN": "example-token",
|
||||
"MAINTENANCE_MODE": "false",
|
||||
"NODE_DB_URI": "mongodb://localhost/habitrpg",
|
||||
"NODE_DB_URI": "mongodb://localhost:27017/habitrpg",
|
||||
"MONGODB_POOL_SIZE": "10",
|
||||
"NODE_ENV": "development",
|
||||
"PATH": "bin:node_modules/.bin:/usr/local/bin:/usr/bin:/bin",
|
||||
@@ -70,7 +70,7 @@
|
||||
"SLACK_URL": "https://hooks.slack.com/services/some-url",
|
||||
"STRIPE_API_KEY": "aaaabbbbccccddddeeeeffff00001111",
|
||||
"STRIPE_PUB_KEY": "22223333444455556666777788889999",
|
||||
"TEST_DB_URI": "mongodb://localhost/habitrpg_test",
|
||||
"TEST_DB_URI": "mongodb://localhost:27017/habitrpg_test",
|
||||
"TRANSIFEX_SLACK_CHANNEL": "transifex",
|
||||
"WEB_CONCURRENCY": 1,
|
||||
"SKIP_SSL_CHECK_KEY": "key",
|
||||
|
||||
@@ -8,9 +8,15 @@ const POOL_SIZE = nconf.get('MONGODB_POOL_SIZE');
|
||||
|
||||
// Do not connect to MongoDB when in maintenance mode
|
||||
if (MAINTENANCE_MODE !== 'true') {
|
||||
const mongooseOptions = !IS_PROD ? {} : {
|
||||
const commonOptions = {
|
||||
useNewUrlParser: true,
|
||||
useUnifiedTopology: true,
|
||||
};
|
||||
|
||||
const mongooseOptions = !IS_PROD ? commonOptions : {
|
||||
keepAlive: 120,
|
||||
connectTimeoutMS: 30000,
|
||||
...commonOptions,
|
||||
};
|
||||
|
||||
if (POOL_SIZE) mongooseOptions.poolSize = Number(POOL_SIZE);
|
||||
|
||||
Reference in New Issue
Block a user