File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -21,8 +21,10 @@ var client = redis.createClient()
2121client . on ( 'error' , handleErrors )
2222client . on ( 'message' , listenMessages )
2323
24- // Subscribe to the pubsub channel
25- for ( var ch of channels ) {
24+ // Subscribe to the pubsub channels
25+ var keys = Object . keys ( channels )
26+ for ( var i of keys ) {
27+ let ch = channels [ i ]
2628 log . info ( `Listening to channel ${ ch . channelName } ` )
2729 client . subscribe ( ch . channelName )
2830}
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ fs.readdirSync(__dirname).forEach((file) => {
1010 if ( file . match ( / - c h a n n e l \. j s $ / ) ) {
1111 let module = require ( './' + file )
1212 let instance = new module ( )
13- channelsList . push ( instance )
13+ channelsList [ instance . channelName ] = instance
1414 }
1515} )
1616
You can’t perform that action at this time.
0 commit comments