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); }); }); };