fix redis bulk zadd

v1.18.x
barisusakli 11 years ago
parent e1211527b0
commit b1f492dec3

@ -15,11 +15,14 @@ module.exports = function(redisClient, module) {
if (scores.length !== values.length) {
return callback(new Error('[[error:invalid-data]]'));
}
var multi = redisClient.multi();
for(var i=0; i<scores.lenth; ++i) {
multi.zadd(key, scores[i], values[i]);
var args = [key];
for(var i=0; i<scores.length; ++i) {
args.push(scores[i], values[i]);
}
multi.exec(function(err, result) {
redisClient.zadd(args, function(err, res) {
callback(err);
});
}

Loading…
Cancel
Save