mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-29 17:42:38 +00:00
Merge branch 'master' into addDBCheckMiddleware
This commit is contained in:
@@ -35,8 +35,11 @@ const disconnect = async ()=>{
|
||||
};
|
||||
|
||||
const connect = async (config)=>{
|
||||
return await Mongoose.connect(getMongoDBURL(config), { retryWrites: false })
|
||||
.then(addListeners(Mongoose))
|
||||
return await Mongoose.connect(getMongoDBURL(config), {
|
||||
retryWrites : false,
|
||||
autoIndex : (config.get('local_environments').includes(config.get('node_env')))
|
||||
})
|
||||
.then(addListeners(Mongoose))
|
||||
.catch((error)=>handleConnectionError(error));
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user