diff --git a/packages/backend/src/queue/index.ts b/packages/backend/src/queue/index.ts index 4d4d9257d..182202260 100644 --- a/packages/backend/src/queue/index.ts +++ b/packages/backend/src/queue/index.ts @@ -340,7 +340,7 @@ export default function() { export function destroy() { deliverQueue.once('cleaned', async (jobs, status) => { deliverLogger.succ(`Cleaned ${jobs.length} ${status} jobs`); - await Promise.all(jobs.map(job => deletionRefCount(job)); + await Promise.all(jobs.map(job => deletionRefCount(job))); }); deliverQueue.clean(0, 'delayed'); diff --git a/packages/backend/src/remote/activitypub/deliver-manager.ts b/packages/backend/src/remote/activitypub/deliver-manager.ts index dfadef150..469464cec 100644 --- a/packages/backend/src/remote/activitypub/deliver-manager.ts +++ b/packages/backend/src/remote/activitypub/deliver-manager.ts @@ -150,17 +150,17 @@ export class DeliverManager { )), ); - inboxes = inboxes.entries() + const filteredInboxes = Array.from(inboxes) .filter(inbox => !instancesToSkip.includes(new URL(inbox).host)); if (deletingUserId) { await Users.update(deletingUserId, { // set deletion job count for reference counting before queueing jobs - isDeleted: inboxes.length, + isDeleted: filteredInboxes.length, }); } - inboxes.forEach(inbox => deliver(this.actor, this.activity, inbox, deletingUserId)); + filteredInboxes.forEach(inbox => deliver(this.actor, this.activity, inbox, deletingUserId)); } }