@@ -27,6 +27,7 @@ class Producer extends EventEmitter {
2727 constructor ( options ) {
2828 super ( ) ;
2929
30+ options = options || { } ;
3031 if ( ! options . queue ) throw new Error ( 'missing queue name' ) ;
3132
3233 this . _redis = utils . createRedisClient ( options . redis ) ;
@@ -47,12 +48,12 @@ class Producer extends EventEmitter {
4748
4849 const callbackKey = utils . getCallbackKey ( this . _redisPrefix , this . queue , this . name ) ;
4950 this . _redisSub . subscribe ( callbackKey , ( channel , count ) => {
50- this . _debug ( 'on subscribe: chennel =%s, count=%s' , channel , count ) ;
51+ this . _debug ( 'on subscribe: channel =%s, count=%s' , channel , count ) ;
5152 this . emit ( 'start' ) ;
5253 } ) ;
5354
54- this . _redisSub . on ( 'message' , ( chennel , message ) => {
55- this . _debug ( 'on reply: %s -> %s' , chennel , message ) ;
55+ this . _redisSub . on ( 'message' , ( channel , message ) => {
56+ this . _debug ( 'on reply: %s -> %s' , channel , message ) ;
5657
5758 // msg: success => id,s,data error => id,e,data
5859 const info = utils . splitString ( message , ',' , 3 ) ;
0 commit comments