1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

fix bug not allowing you to quit while in subscribe mode - added test

This commit is contained in:
Orion Henry
2010-09-27 17:11:12 -07:00
parent 01068565d9
commit dcbb87dff7
2 changed files with 10 additions and 3 deletions

View File

@@ -564,11 +564,10 @@ RedisClient.prototype.send_command = function () {
}
this.subscriptions = true;
} else {
if (this.subscriptions === true) {
throw new Error("Connection in pub/sub mode, only pub/sub commands may be used");
}
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");
}
this.command_queue.push(command_obj);
}