From 619819dedcd80a85b2d9ad0733c03c683ac37a1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Sun, 25 Jan 2026 19:48:55 -0500 Subject: [PATCH 1/2] chore: fix typo in upgrade script name --- src/upgrades/4.8.2/clean_ap_tids_from_topic_zsets.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/upgrades/4.8.2/clean_ap_tids_from_topic_zsets.js b/src/upgrades/4.8.2/clean_ap_tids_from_topic_zsets.js index d5ce541eb9..b87924901b 100644 --- a/src/upgrades/4.8.2/clean_ap_tids_from_topic_zsets.js +++ b/src/upgrades/4.8.2/clean_ap_tids_from_topic_zsets.js @@ -5,7 +5,7 @@ const batch = require('../../batch'); const utils = require('../../utils'); module.exports = { - name: 'Remote AP tids from topics:recent, topics:views, topics:posts, topics:votes zsets', + name: 'Remove AP tids from topics:recent, topics:views, topics:posts, topics:votes zsets', timestamp: Date.UTC(2026, 0, 25), method: async function () { const { progress } = this; From a82f18ccfb07f829f152182dffeab717a217e29d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Sun, 25 Jan 2026 19:56:11 -0500 Subject: [PATCH 2/2] chore: fix progress --- .../4.8.2/clean_ap_tids_from_topic_zsets.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/upgrades/4.8.2/clean_ap_tids_from_topic_zsets.js b/src/upgrades/4.8.2/clean_ap_tids_from_topic_zsets.js index b87924901b..d598ba1e80 100644 --- a/src/upgrades/4.8.2/clean_ap_tids_from_topic_zsets.js +++ b/src/upgrades/4.8.2/clean_ap_tids_from_topic_zsets.js @@ -14,7 +14,7 @@ module.exports = { ]); progress.total = recent + views + posts + votes; - async function cleanupSet(setName, count) { + async function cleanupSet(setName) { const tidsToRemove = []; await batch.processSortedSet(setName, async (tids) => { 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) ).map(t => t.tid); tidsToRemove.push(...batchTids); - progress.incr(batchTids.length); + progress.incr(tids.length); }, { batch: 500, }); @@ -32,11 +32,11 @@ module.exports = { }, { batch: 500, }); - progress.incr(count); + } - await cleanupSet('topics:recent', recent); - await cleanupSet('topics:views', views); - await cleanupSet('topics:posts', posts); - await cleanupSet('topics:votes', votes); + await cleanupSet('topics:recent'); + await cleanupSet('topics:views'); + await cleanupSet('topics:posts'); + await cleanupSet('topics:votes'); }, };