From bcfac00becaf3b6b305c8b5a7813acaada564c42 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 10 Jun 2024 12:30:44 -0400 Subject: [PATCH] fix: unintentional parseInt during post purge --- src/activitypub/notes.js | 2 ++ src/posts/delete.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/activitypub/notes.js b/src/activitypub/notes.js index 689ceca2a6..f1fd7ce89b 100644 --- a/src/activitypub/notes.js +++ b/src/activitypub/notes.js @@ -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.'); }; diff --git a/src/posts/delete.js b/src/posts/delete.js index e4e4e59438..5a2a615e26 100644 --- a/src/posts/delete.js +++ b/src/posts/delete.js @@ -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 = [];