0
0
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:
G.Ambatte
2025-10-05 14:58:56 +13:00
committed by GitHub
20 changed files with 374 additions and 239 deletions

View File

@@ -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));
};