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

@@ -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) {