mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 23:15:48 +01:00
feat: use getSortedSetsMembers to load followed tids
This commit is contained in:
@@ -177,9 +177,9 @@ module.exports = function (Topics) {
|
||||
}
|
||||
|
||||
async function getFollowedTids(params) {
|
||||
const tids = await db.getSortedSetRevRange('uid:' + params.uid + ':followed_tids', 0, -1);
|
||||
const scores = await db.sortedSetScores('topics:recent', tids);
|
||||
const data = tids.map((tid, index) => ({ value: tid, score: scores[index] }));
|
||||
const tids = await db.getSortedSetsMembers(['uid:' + params.uid + ':followed_tids']);
|
||||
const scores = await db.sortedSetScores('topics:recent', tids[0]);
|
||||
const data = tids[0].map((tid, index) => ({ value: tid, score: scores[index] }));
|
||||
return data.filter(item => item.score > params.cutoff);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user