mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: maybe last tweak
This commit is contained in:
@@ -13,10 +13,15 @@ module.exports = {
|
|||||||
const { progress } = this;
|
const { progress } = this;
|
||||||
const interval = 1500;
|
const interval = 1500;
|
||||||
|
|
||||||
await batch.processSortedSet('usersRemote:lastCrawled', async (ids) => {
|
let actorIds = await db.getSortedSetMembers('usersRemote:lastCrawled');
|
||||||
const exists = await Promise.all(ids.map(async id => await db.isObjectField(`userRemote:${id}`, 'url')));
|
progress.total = actorIds.length;
|
||||||
ids = ids.filter((id, idx) => exists[idx]);
|
const exists = await Promise.all(actorIds.map(async id => await db.isObjectField(`userRemote:${id}`, 'url')));
|
||||||
|
actorIds = actorIds.filter((id, idx) => exists[idx]);
|
||||||
|
|
||||||
|
// Increment ones that were already completed
|
||||||
|
progress.incr(progress.total - actorIds.length);
|
||||||
|
|
||||||
|
await batch.processArray(actorIds, async (ids) => {
|
||||||
try {
|
try {
|
||||||
await activitypub.actors.assert(ids, { update: true });
|
await activitypub.actors.assert(ids, { update: true });
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user