mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-12 17:05:51 +01:00
fix redis tests
This commit is contained in:
@@ -4,7 +4,9 @@
|
||||
module.exports = function (redisClient, module) {
|
||||
module.sortedSetUnionCard = function (keys, callback) {
|
||||
var tempSetName = 'temp_' + Date.now();
|
||||
|
||||
if (!keys.length) {
|
||||
return setImmediate(callback, null, 0);
|
||||
}
|
||||
var multi = redisClient.multi();
|
||||
multi.zunionstore([tempSetName, keys.length].concat(keys));
|
||||
multi.zcard(tempSetName);
|
||||
@@ -29,6 +31,10 @@ module.exports = function (redisClient, module) {
|
||||
};
|
||||
|
||||
module.sortedSetUnion = function (params, callback) {
|
||||
if (!params.sets.length) {
|
||||
return setImmediate(callback, null, []);
|
||||
}
|
||||
|
||||
var tempSetName = 'temp_' + Date.now();
|
||||
|
||||
var rangeParams = [tempSetName, params.start, params.stop];
|
||||
|
||||
Reference in New Issue
Block a user