File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,14 @@ function RedisClient(stream, options) {
81
81
82
82
this . old_state = null ;
83
83
84
+ this . install_stream_listeners ( ) ;
85
+
86
+ events . EventEmitter . call ( this ) ;
87
+ }
88
+ util . inherits ( RedisClient , events . EventEmitter ) ;
89
+ exports . RedisClient = RedisClient ;
90
+
91
+ RedisClient . prototype . install_stream_listeners = function ( ) {
84
92
var self = this ;
85
93
86
94
this . stream . on ( "connect" , function ( ) {
@@ -107,11 +115,7 @@ function RedisClient(stream, options) {
107
115
self . should_buffer = false ;
108
116
self . emit ( "drain" ) ;
109
117
} ) ;
110
-
111
- events . EventEmitter . call ( this ) ;
112
- }
113
- util . inherits ( RedisClient , events . EventEmitter ) ;
114
- exports . RedisClient = RedisClient ;
118
+ } ;
115
119
116
120
RedisClient . prototype . initialize_retry_vars = function ( ) {
117
121
this . retry_timer = null ;
@@ -520,7 +524,8 @@ RedisClient.prototype.connection_gone = function (why) {
520
524
return ;
521
525
}
522
526
523
- self . stream . connect ( self . port , self . host ) ;
527
+ self . stream = net . createConnection ( self . port , self . host ) ;
528
+ self . install_stream_listeners ( ) ;
524
529
self . retry_timer = null ;
525
530
} , this . retry_delay ) ;
526
531
} ;
You can’t perform that action at this time.
0 commit comments