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

Make .end flush optional and add some tests

This commit is contained in:
Ruben Bridgewater
2015-09-24 13:27:32 +02:00
parent 4b100b8b64
commit bd4fca130d
5 changed files with 48 additions and 6 deletions

View File

@@ -838,7 +838,7 @@ RedisClient.prototype.pub_sub_command = function (command_obj) {
}
};
RedisClient.prototype.end = function () {
RedisClient.prototype.end = function (flush) {
this.stream._events = {};
// Clear retry_timer
@@ -848,8 +848,10 @@ RedisClient.prototype.end = function () {
}
this.stream.on("error", function noop(){});
// Flush queue
this.flush_and_error("Redis connection ended.");
// Flush queue if wanted
if (flush) {
this.flush_and_error("Redis connection ended.");
}
this.connected = false;
this.ready = false;