mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 04:25:55 +01:00
add again
This commit is contained in:
@@ -59,8 +59,8 @@ mongoModule.questions = [
|
||||
},
|
||||
];
|
||||
|
||||
mongoModule.init = async function () {
|
||||
client = await connection.connect(nconf.get('mongo'));
|
||||
mongoModule.init = async function (opts) {
|
||||
client = await connection.connect(opts || nconf.get('mongo'));
|
||||
mongoModule.client = client.db();
|
||||
};
|
||||
|
||||
@@ -175,6 +175,9 @@ async function getCollectionStats(db) {
|
||||
|
||||
mongoModule.close = async function () {
|
||||
await client.close();
|
||||
if (mongoModule.objectCache) {
|
||||
mongoModule.objectCache.reset();
|
||||
}
|
||||
};
|
||||
|
||||
require('./mongo/main')(mongoModule);
|
||||
|
||||
Reference in New Issue
Block a user