Skip to content

Commit

Permalink
Fix issue where admin bus crashes when "db" or "pass" is not specifie…
Browse files Browse the repository at this point in the history
…d in redis config
  • Loading branch information
sgress454 committed Jan 15, 2016
1 parent 410806c commit 14210dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/connect-to-admin-bus.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ module.exports = function (app) {

return function connectToAdminBus(adapterDef, cb){

// Indicate that this connection is for the admin bus
adapterDef.adminBus = true;

// Prepare the driver for the admin bus (e.g. Redis)
prepareDriver(adapterDef, function(err) {
if (err) {return cb(err);}
Expand Down
2 changes: 1 addition & 1 deletion lib/prepare-driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = function (app){
if (adapterModuleName === 'socket.io-redis') {

// Create raw redis clients if necessary
var rawClientsNecessary = adapterConfig.pass || adapterConfig.db;
var rawClientsNecessary = adapterConfig.pass || adapterConfig.db || adapterDef.adminBus;
if (!rawClientsNecessary) {
return cb();
}
Expand Down

0 comments on commit 14210dc

Please sign in to comment.