fix: use getSortedSetRange instead of getSortedSetsMembers

This commit is contained in:
Julian Lam
2020-12-09 17:12:59 -05:00
parent bd5c4a5cff
commit edf67f349f

View File

@@ -28,7 +28,7 @@ Thumbs.get = async function (tids) {
}
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 => ({
id: tids[idx],
name: path.basename(thumb),