Skip to content

Node.js based forum software built for the modern web

reset and show progress

Barış Soner Uşaklıbec10b01c737
diff --git a/src/upgrades/4.9.0/postsRemote_zset.js b/src/upgrades/4.9.0/postsRemote_zset.js
index 31c856c88f..445fa69e91 100644
--- a/src/upgrades/4.9.0/postsRemote_zset.js
+++ b/src/upgrades/4.9.0/postsRemote_zset.js
@@ -24,9 +24,12 @@ module.exports = {
batch: 500,
withScores: true,
});
-
+ progress.current = 0;
+ progress.counter = 0;
+ progress.total = removePosts.length;
await batch.processArray(removePosts, async (pids) => {
await db.sortedSetRemove(['posts:pid', 'posts:votes'], pids);
+ progress.incr(pids.length);
}, {
batch: 500,
});
diff --git a/src/upgrades/4.9.0/topicsRemote_zset.js b/src/upgrades/4.9.0/topicsRemote_zset.js
index 5e0bd59cae..616b6bed38 100644
--- a/src/upgrades/4.9.0/topicsRemote_zset.js
+++ b/src/upgrades/4.9.0/topicsRemote_zset.js
@@ -25,8 +25,12 @@ module.exports = {
withScores: true,
});
+ progress.current = 0;
+ progress.counter = 0;
+ progress.total = removeTopics.length;
await batch.processArray(removeTopics, async (tids) => {
await db.sortedSetRemove('topics:tid', tids);
+ progress.incr(tids.length);
}, {
batch: 500,
});