You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-07 13:22:56 +03:00
only re-initializing retry variables if the connection is really connected
This commit is contained in:
4
index.js
4
index.js
@@ -229,6 +229,8 @@ RedisClient.prototype.do_auth = function () {
|
|||||||
|
|
||||||
// now we are really connected
|
// now we are really connected
|
||||||
self.emit("connect");
|
self.emit("connect");
|
||||||
|
self.initialize_retry_vars();
|
||||||
|
|
||||||
if (self.options.no_ready_check) {
|
if (self.options.no_ready_check) {
|
||||||
self.on_ready();
|
self.on_ready();
|
||||||
} else {
|
} else {
|
||||||
@@ -248,7 +250,6 @@ RedisClient.prototype.on_connect = function () {
|
|||||||
this.connections += 1;
|
this.connections += 1;
|
||||||
this.command_queue = new Queue();
|
this.command_queue = new Queue();
|
||||||
this.emitted_end = false;
|
this.emitted_end = false;
|
||||||
this.initialize_retry_vars();
|
|
||||||
if (this.options.socket_nodelay) {
|
if (this.options.socket_nodelay) {
|
||||||
this.stream.setNoDelay();
|
this.stream.setNoDelay();
|
||||||
}
|
}
|
||||||
@@ -260,6 +261,7 @@ RedisClient.prototype.on_connect = function () {
|
|||||||
this.do_auth();
|
this.do_auth();
|
||||||
} else {
|
} else {
|
||||||
this.emit("connect");
|
this.emit("connect");
|
||||||
|
this.initialize_retry_vars();
|
||||||
|
|
||||||
if (this.options.no_ready_check) {
|
if (this.options.no_ready_check) {
|
||||||
this.on_ready();
|
this.on_ready();
|
||||||
|
Reference in New Issue
Block a user