fix setAdd on redis for empty arrays

v1.18.x
barisusakli 8 years ago
parent 543a403fa8
commit 0d09fcbee7

@ -5,6 +5,12 @@ module.exports = function(redisClient, module) {
module.setAdd = function(key, value, callback) {
callback = callback || function() {};
if (!Array.isArray(value)) {
value = [value];
}
if (!value.length) {
return callback();
}
redisClient.sadd(key, value, function(err, res) {
callback(err);
});

Loading…
Cancel
Save