0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 16:22:44 +00:00

Add autobuild to Mongoose connection (local/docker ONLY)

This commit is contained in:
G.Ambatte
2025-07-20 11:43:14 +12:00
parent 878ea1449d
commit d9cd270f3b

View File

@@ -27,7 +27,10 @@ const disconnect = async ()=>{
};
const connect = async (config)=>{
return await Mongoose.connect(getMongoDBURL(config), { retryWrites: false })
return await Mongoose.connect(getMongoDBURL(config), {
retryWrites : false,
autoIndex : (config.get('node_env') == 'local' || config.get('node_env') == 'docker')
})
.catch((error)=>handleConnectionError(error));
};