Skip to content

Commit b12817c

Browse files
committed
Merge branch 'uber-fix_recon'
2 parents c68b3f7 + c687d2e commit b12817c

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

index.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@ function RedisClient(stream, options) {
8181

8282
this.old_state = null;
8383

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() {
8492
var self = this;
8593

8694
this.stream.on("connect", function () {
@@ -107,11 +115,7 @@ function RedisClient(stream, options) {
107115
self.should_buffer = false;
108116
self.emit("drain");
109117
});
110-
111-
events.EventEmitter.call(this);
112-
}
113-
util.inherits(RedisClient, events.EventEmitter);
114-
exports.RedisClient = RedisClient;
118+
};
115119

116120
RedisClient.prototype.initialize_retry_vars = function () {
117121
this.retry_timer = null;
@@ -520,7 +524,8 @@ RedisClient.prototype.connection_gone = function (why) {
520524
return;
521525
}
522526

523-
self.stream.connect(self.port, self.host);
527+
self.stream = net.createConnection(self.port, self.host);
528+
self.install_stream_listeners();
524529
self.retry_timer = null;
525530
}, this.retry_delay);
526531
};

0 commit comments

Comments
 (0)