1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-04 15:02:09 +03:00

Support redis 2.4 info command

Fixes #1008
This commit is contained in:
Ruben Bridgewater
2016-03-16 23:40:25 +01:00
parent eb9500bb9f
commit 359820c766
2 changed files with 20 additions and 8 deletions

View File

@@ -37,14 +37,14 @@ RedisClient.prototype.select = RedisClient.prototype.SELECT = function select (d
RedisClient.prototype.info = RedisClient.prototype.INFO = function info (section, callback) {
var self = this;
var ready = this.ready;
var args = [];
if (typeof section === 'function') {
callback = section;
section = 'default';
} else if (section === undefined) {
section = 'default';
} else if (section !== undefined) {
args = Array.isArray(section) ? section : [section];
}
this.ready = ready || this.offline_queue.length === 0; // keep the execution order intakt
var tmp = this.send_command('info', [section], function (err, res) {
var tmp = this.send_command('info', args, function (err, res) {
if (res) {
var obj = {};
var lines = res.toString().split('\r\n');