From ae146024af0032f6c6bc08618d85993eda7ffc75 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 4 Apr 2024 12:33:07 -0400 Subject: [PATCH] fix: tweak upgrade script again --- src/upgrades/4.0.0/remote_user_urls.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/upgrades/4.0.0/remote_user_urls.js b/src/upgrades/4.0.0/remote_user_urls.js index 15bde93276..4b59a351b6 100644 --- a/src/upgrades/4.0.0/remote_user_urls.js +++ b/src/upgrades/4.0.0/remote_user_urls.js @@ -8,10 +8,10 @@ const activitypub = require('../../activitypub'); module.exports = { name: 'Re-assert all existing actors to save URL into hash', timestamp: Date.UTC(2024, 3, 4), - method: async () => { + method: async function () { const batch = require('../../batch'); const { progress } = this; - const interval = 5000; + const interval = 1500; await batch.processSortedSet('usersRemote:lastCrawled', async (ids) => { const exists = await Promise.all(ids.map(async id => await db.isObjectField(`userRemote:${id}`, 'url'))); @@ -22,6 +22,8 @@ module.exports = { } catch (e) { // noop } + + progress.incr(ids.length); }, { progress, interval }); }, };