fix mongoose options

This commit is contained in:
Matteo Pagliazzi
2018-02-03 22:17:10 +01:00
parent 6d0917964b
commit 8bd3ef6f24
2 changed files with 2 additions and 0 deletions

View File

@@ -26,6 +26,7 @@ let improveRepl = (context) => {
const mongooseOptions = !isProd ? {} : {
keepAlive: 1,
connectTimeoutMS: 30000,
useMongoClient: true,
};
mongoose.connect(
nconf.get('NODE_DB_URI'),

View File

@@ -14,6 +14,7 @@ if (MAINTENANCE_MODE !== 'true') {
const mongooseOptions = !IS_PROD ? {} : {
keepAlive: 120,
connectTimeoutMS: 30000,
useMongoClient: true,
};
const NODE_DB_URI = nconf.get('IS_TEST') ? nconf.get('TEST_DB_URI') : nconf.get('NODE_DB_URI');