mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-14 10:37:45 +01:00
chore: fix progress
This commit is contained in:
@@ -14,7 +14,7 @@ module.exports = {
|
|||||||
]);
|
]);
|
||||||
progress.total = recent + views + posts + votes;
|
progress.total = recent + views + posts + votes;
|
||||||
|
|
||||||
async function cleanupSet(setName, count) {
|
async function cleanupSet(setName) {
|
||||||
const tidsToRemove = [];
|
const tidsToRemove = [];
|
||||||
await batch.processSortedSet(setName, async (tids) => {
|
await batch.processSortedSet(setName, async (tids) => {
|
||||||
const topicData = await db.getObjectsFields(tids.map(tid => `topic:${tid}`), ['tid', 'cid']);
|
const topicData = await db.getObjectsFields(tids.map(tid => `topic:${tid}`), ['tid', 'cid']);
|
||||||
@@ -22,7 +22,7 @@ module.exports = {
|
|||||||
t => t && (!t.cid || !utils.isNumber(t.cid) || t.cid === -1)
|
t => t && (!t.cid || !utils.isNumber(t.cid) || t.cid === -1)
|
||||||
).map(t => t.tid);
|
).map(t => t.tid);
|
||||||
tidsToRemove.push(...batchTids);
|
tidsToRemove.push(...batchTids);
|
||||||
progress.incr(batchTids.length);
|
progress.incr(tids.length);
|
||||||
}, {
|
}, {
|
||||||
batch: 500,
|
batch: 500,
|
||||||
});
|
});
|
||||||
@@ -32,11 +32,11 @@ module.exports = {
|
|||||||
}, {
|
}, {
|
||||||
batch: 500,
|
batch: 500,
|
||||||
});
|
});
|
||||||
progress.incr(count);
|
|
||||||
}
|
}
|
||||||
await cleanupSet('topics:recent', recent);
|
await cleanupSet('topics:recent');
|
||||||
await cleanupSet('topics:views', views);
|
await cleanupSet('topics:views');
|
||||||
await cleanupSet('topics:posts', posts);
|
await cleanupSet('topics:posts');
|
||||||
await cleanupSet('topics:votes', votes);
|
await cleanupSet('topics:votes');
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user