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

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'),

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');