fix mongoose options

This commit is contained in:
Matteo Pagliazzi
2018-02-03 22:15:40 +01:00
parent d463e2373e
commit 6d0917964b
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -24,8 +24,8 @@ let improveRepl = (context) => {
const isProd = nconf.get('NODE_ENV') === 'production';
const mongooseOptions = !isProd ? {} : {
replset: { socketOptions: { keepAlive: 1, connectTimeoutMS: 30000 } },
server: { socketOptions: { keepAlive: 1, connectTimeoutMS: 30000 } },
keepAlive: 1,
connectTimeoutMS: 30000,
};
mongoose.connect(
nconf.get('NODE_DB_URI'),
+3 -3
View File
@@ -11,9 +11,9 @@ mongoose.Promise = Bluebird;
// Do not connect to MongoDB when in maintenance mode
if (MAINTENANCE_MODE !== 'true') {
let mongooseOptions = !IS_PROD ? {} : {
replset: { socketOptions: { keepAlive: 120, connectTimeoutMS: 30000 } },
server: { socketOptions: { keepAlive: 120, connectTimeoutMS: 30000 } },
const mongooseOptions = !IS_PROD ? {} : {
keepAlive: 120,
connectTimeoutMS: 30000,
};
const NODE_DB_URI = nconf.get('IS_TEST') ? nconf.get('TEST_DB_URI') : nconf.get('NODE_DB_URI');