You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-07 13:22:56 +03:00
index.js: fix enable_offline_queue default. tests pass
This commit is contained in:
6
index.js
6
index.js
@@ -50,7 +50,11 @@ function RedisClient(stream, options) {
|
|||||||
if (options.connect_timeout && !isNaN(options.connect_timeout) && options.connect_timeout > 0) {
|
if (options.connect_timeout && !isNaN(options.connect_timeout) && options.connect_timeout > 0) {
|
||||||
this.connect_timeout = +options.connect_timeout;
|
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.initialize_retry_vars();
|
||||||
this.pub_sub_mode = false;
|
this.pub_sub_mode = false;
|
||||||
|
3
test.js
3
test.js
@@ -1415,6 +1415,9 @@ tests.ENABLE_OFFLINE_QUEUE_FALSE = function () {
|
|||||||
cli.set(name, name, function (err) {
|
cli.set(name, name, function (err) {
|
||||||
// should callback with an error
|
// should callback with an error
|
||||||
assert.ok(err);
|
assert.ok(err);
|
||||||
|
setTimeout(function () {
|
||||||
|
next(name);
|
||||||
|
}, 50);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user