mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 19:46:01 +01:00
fix redis union
This commit is contained in:
@@ -29,7 +29,7 @@ module.exports = function (redisClient, module) {
|
|||||||
|
|
||||||
function sortedSetRange(method, key, start, stop, withScores, callback) {
|
function sortedSetRange(method, key, start, stop, withScores, callback) {
|
||||||
if (Array.isArray(key)) {
|
if (Array.isArray(key)) {
|
||||||
return sortedSetUnion({method: method, sets: key, start: start, stop: stop, withScores: withScores}, callback);
|
return module.sortedSetUnion({method: method, sets: key, start: start, stop: stop, withScores: withScores}, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
var params = [key, start, stop];
|
var params = [key, start, stop];
|
||||||
|
|||||||
@@ -21,15 +21,15 @@ module.exports = function (redisClient, module) {
|
|||||||
|
|
||||||
module.getSortedSetUnion = function (params, callback) {
|
module.getSortedSetUnion = function (params, callback) {
|
||||||
params.method = 'zrange';
|
params.method = 'zrange';
|
||||||
sortedSetUnion(params, callback);
|
module.sortedSetUnion(params, callback);
|
||||||
};
|
};
|
||||||
|
|
||||||
module.getSortedSetRevUnion = function (params, callback) {
|
module.getSortedSetRevUnion = function (params, callback) {
|
||||||
params.method = 'zrevrange';
|
params.method = 'zrevrange';
|
||||||
sortedSetUnion(params, callback);
|
module.sortedSetUnion(params, callback);
|
||||||
};
|
};
|
||||||
|
|
||||||
function sortedSetUnion(params, callback) {
|
module.sortedSetUnion = function (params, callback) {
|
||||||
|
|
||||||
var tempSetName = 'temp_' + Date.now();
|
var tempSetName = 'temp_' + Date.now();
|
||||||
|
|
||||||
@@ -56,5 +56,5 @@ module.exports = function (redisClient, module) {
|
|||||||
}
|
}
|
||||||
callback(null, objects);
|
callback(null, objects);
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
};
|
};
|
||||||
Reference in New Issue
Block a user