mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-11 07:00:51 +01:00
moving db.close into the parent module
This commit is contained in:
@@ -38,14 +38,14 @@
|
||||
winston.error('Unable to initialize Level DB! Is Level DB installed? Error :' + err.message);
|
||||
process.exit();
|
||||
}
|
||||
|
||||
|
||||
if (db) {
|
||||
if(typeof callback === 'function') {
|
||||
callback();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
db = levelup(nconf.get('level:database'), {
|
||||
valueEncoding: 'json'
|
||||
@@ -77,6 +77,10 @@
|
||||
}
|
||||
};
|
||||
|
||||
module.close = function(callback) {
|
||||
db.close(callback);
|
||||
};
|
||||
|
||||
var helpers = {};
|
||||
|
||||
helpers.iterator = function(fn, keys, value, callback) {
|
||||
|
||||
Reference in New Issue
Block a user