Skip to content
This repository has been archived by the owner on Aug 3, 2018. It is now read-only.

Commit

Permalink
fix(mongoose): add keepAlive options (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
binarious authored May 23, 2017
1 parent 24a78aa commit 52a8065
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/config/mongoose.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ export default (mongoose) => {

// Connect to our MongoDB database using the MongoDB
// connection URI from our predefined environment variable
mongoose.connect(process.env.MONGO_URI, (error) => {
mongoose.connect(process.env.MONGO_URI, {
keepAlive: 1,
connectTimeoutMS: 30000,
reconnectTries: 30,
reconnectInterval: 5000
}, (error) => {

if (error)
throw error;
Expand Down

0 comments on commit 52a8065

Please sign in to comment.