mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-26 16:41:21 +01:00
fix: numThumb upgrade script
This commit is contained in:
@@ -13,7 +13,7 @@ module.exports = {
|
|||||||
await batch.processSortedSet('topics:tid', async (tids) => {
|
await batch.processSortedSet('topics:tid', async (tids) => {
|
||||||
const keys = tids.map(tid => `topic:${tid}:thumbs`);
|
const keys = tids.map(tid => `topic:${tid}:thumbs`);
|
||||||
const counts = await db.sortedSetsCard(keys);
|
const counts = await db.sortedSetsCard(keys);
|
||||||
const tidToCount = _.zip(tids, counts);
|
const tidToCount = _.zipObject(tids, counts);
|
||||||
const tidsWithThumbs = tids.filter((t, i) => counts[i] > 0);
|
const tidsWithThumbs = tids.filter((t, i) => counts[i] > 0);
|
||||||
await db.setObjectBulk(
|
await db.setObjectBulk(
|
||||||
tidsWithThumbs.map(tid => `topic:${tid}`),
|
tidsWithThumbs.map(tid => `topic:${tid}`),
|
||||||
|
|||||||
Reference in New Issue
Block a user