mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: use getSortedSetRange instead of getSortedSetsMembers
This commit is contained in:
@@ -28,7 +28,7 @@ Thumbs.get = async function (tids) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const sets = tids.map(tid => `${validator.isUUID(String(tid)) ? 'draft' : 'topic'}:${tid}:thumbs`);
|
const sets = tids.map(tid => `${validator.isUUID(String(tid)) ? 'draft' : 'topic'}:${tid}:thumbs`);
|
||||||
const thumbs = await db.getSortedSetsMembers(sets);
|
const thumbs = await Promise.all(sets.map(async set => db.getSortedSetRange(set, 0, -1)));
|
||||||
let response = thumbs.map((thumbSet, idx) => thumbSet.map(thumb => ({
|
let response = thumbs.map((thumbSet, idx) => thumbSet.map(thumb => ({
|
||||||
id: tids[idx],
|
id: tids[idx],
|
||||||
name: path.basename(thumb),
|
name: path.basename(thumb),
|
||||||
|
|||||||
Reference in New Issue
Block a user