From 1b0b2dc87dc5c92525af24b90f19ea5e63ee41b9 Mon Sep 17 00:00:00 2001 From: DTrejo Date: Thu, 5 Jul 2012 19:18:26 -0700 Subject: [PATCH] index.js: fix enable_offline_queue default. tests pass --- index.js | 6 +++++- test.js | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index dacc113f41..bd8c16a2ef 100644 --- a/index.js +++ b/index.js @@ -50,7 +50,11 @@ function RedisClient(stream, options) { if (options.connect_timeout && !isNaN(options.connect_timeout) && options.connect_timeout > 0) { this.connect_timeout = +options.connect_timeout; } - this.enable_offline_queue = this.options.enable_offline_queue || true; + + this.enable_offline_queue = true; + if (typeof this.options.enable_offline_queue === "boolean") { + this.enable_offline_queue = this.options.enable_offline_queue; + } this.initialize_retry_vars(); this.pub_sub_mode = false; diff --git a/test.js b/test.js index 222abad37d..f6f7f0e3be 100644 --- a/test.js +++ b/test.js @@ -1415,6 +1415,9 @@ tests.ENABLE_OFFLINE_QUEUE_FALSE = function () { cli.set(name, name, function (err) { // should callback with an error assert.ok(err); + setTimeout(function () { + next(name); + }, 50); }); }); };