Skip to content

Commit

Permalink
Moving some logic that should fix the idle event
Browse files Browse the repository at this point in the history
Signed-off-by: DTrejo <[email protected]>
  • Loading branch information
trobrock authored and DTrejo committed Jul 6, 2012
1 parent b60e001 commit 2224767
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -525,8 +525,9 @@ function reply_to_strings(reply) {

RedisClient.prototype.return_reply = function (reply) {
var command_obj, obj, i, len, type, timestamp, argindex, args, queue_len;

queue_len = this.command_queue.getLength();

command_obj = this.command_queue.shift()
queue_len = this.command_queue.getLength();

if (this.pub_sub_mode === false && queue_len === 0) {
this.emit("idle");
Expand All @@ -537,8 +538,6 @@ RedisClient.prototype.return_reply = function (reply) {
this.should_buffer = false;
}

command_obj = this.command_queue.shift();

if (command_obj && !command_obj.sub_command) {
if (typeof command_obj.callback === "function") {
if (this.options.detect_buffers && command_obj.buffer_args === false) {
Expand Down

0 comments on commit 2224767

Please sign in to comment.