Skip to content

Commit

Permalink
fix(models): try to keep alive db connection
Browse files Browse the repository at this point in the history
  • Loading branch information
dsevillamartin committed Oct 12, 2017
1 parent d84e0fe commit 6657d0a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/Models/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ const mongoose = require('mongoose');

mongoose.connect(process.env.YAPPY_GITLAB_MONGODB || 'localhost', {
useMongoClient: true,
server: { socketOptions: { keepAlive: 1, connectTimeoutMS: 30000 } },
replset: { socketOptions: { keepAlive: 1, connectTimeoutMS: 30000 } },
})
.then(() => {
Log.info(`MongoDB | Connected to DB`);
Expand Down

0 comments on commit 6657d0a

Please sign in to comment.