moving db.close into the parent module

This commit is contained in:
psychobunny
2014-04-14 13:51:45 -04:00
parent df5f3d185a
commit bba3df6802
6 changed files with 18 additions and 15 deletions

View File

@@ -45,7 +45,7 @@
winston.error('Unable to initialize MongoDB! Is MongoDB installed? Error :' + err.message);
process.exit();
}
mongoClient.connect('mongodb://'+ nconf.get('mongo:host') + ':' + nconf.get('mongo:port') + '/' + nconf.get('mongo:database'), function(err, _db) {
if(err) {
winston.error("NodeBB could not connect to your Mongo database. Mongo returned the following error: " + err.message);
@@ -105,6 +105,11 @@
});
};
module.close = function() {
db.close();
};
var helpers = {};
helpers.findItem = function(data, key) {
if(!data) {