fixed db connections

This commit is contained in:
Andris Reinman 2017-12-20 15:22:18 +02:00
parent 9d3453d645
commit 0fea3840ff

View file

@ -40,17 +40,17 @@ module.exports.connect = callback => {
if (err) {
return callback(err);
}
module.exports.gridfs = gdb;
module.exports.gridfs = gdb || db;
getDBConnection(db, config.dbs.users, (err, udb) => {
if (err) {
return callback(err);
}
module.exports.users = udb;
module.exports.users = udb || db;
getDBConnection(db, config.dbs.sender, (err, sdb) => {
if (err) {
return callback(err);
}
module.exports.senderDb = sdb;
module.exports.senderDb = sdb || db;
module.exports.redisConfig = tools.redisConfig(config.dbs.redis);
module.exports.redis = new Redis(module.exports.redisConfig);