You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
Fixes the case where if the quit() method is called, the closing variable checks are not honoured.
This commit is contained in:
9
index.js
9
index.js
@@ -94,7 +94,7 @@ function RedisClient(stream, options) {
|
||||
});
|
||||
|
||||
this.stream.on("error", function (msg) {
|
||||
if (this.closing) {
|
||||
if (self.closing) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -503,6 +503,11 @@ RedisClient.prototype.send_command = function (command, args, callback) {
|
||||
throw new Error("send_command: second argument must be an array");
|
||||
}
|
||||
|
||||
if (command === "quit") {
|
||||
this.closing = true;
|
||||
return;
|
||||
}
|
||||
|
||||
command_obj = new Command(command, args, false, callback);
|
||||
|
||||
if ((!this.ready && !this.send_anyway) || !stream.writable) {
|
||||
@@ -526,8 +531,6 @@ RedisClient.prototype.send_command = function (command, args, callback) {
|
||||
this.subscriptions = true;
|
||||
} else if (command === "monitor") {
|
||||
this.monitoring = true;
|
||||
} else if (command === "quit") {
|
||||
this.closing = true;
|
||||
} else if (this.subscriptions === true) {
|
||||
throw new Error("Connection in pub/sub mode, only pub/sub commands may be used");
|
||||
}
|
||||
|
Reference in New Issue
Block a user