From a8ee9cdb13d6358767184b810d42a7a011ea7e47 Mon Sep 17 00:00:00 2001 From: Bryce Baril Date: Sat, 27 Apr 2013 08:10:37 -0700 Subject: [PATCH] Deprecate end() by having it call quit() instead. Marked for eventual removal. Fixes #419 --- index.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 012a7d0ca1..3455fb8bdc 100644 --- a/index.js +++ b/index.js @@ -855,12 +855,14 @@ RedisClient.prototype.pub_sub_command = function (command_obj) { } }; +// Warning! end() has been deprecated and will go away +// in later versions of this client. Please consider switching to +// quit() everywhere you use end. RedisClient.prototype.end = function () { - this.stream._events = {}; - this.connected = false; - this.ready = false; - this.closing = true; - return this.stream.end(); + if (exports.debug_mode) { + console.log("Using deprecated .end() method!"); + } + return this.quit(); }; function Multi(client, args) {