fix: unintentional parseInt during post purge

This commit is contained in:
Julian Lam
2024-06-10 12:30:44 -04:00
parent dac2cd2549
commit bcfac00bec
2 changed files with 3 additions and 1 deletions

View File

@@ -417,4 +417,6 @@ Notes.prune = async () => {
await batch.processArray(tids, async (tids) => {
await Promise.all(tids.map(async tid => await topics.purgePostsAndTopic(tid, 0)));
}, { batch: 100 });
winston.info('[notes/prune] Scheduled pruning of topics complete.');
};

View File

@@ -115,7 +115,7 @@ module.exports = function (Posts) {
incrObjectBulk.push([`category:${cid}`, { post_count: -posts.length }]);
}
const postsByTopic = _.groupBy(postData, p => parseInt(p.tid, 10));
const postsByTopic = _.groupBy(postData, p => String(p.tid));
const topicPostCountTasks = [];
const topicTasks = [];
const zsetIncrBulk = [];