mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-21 16:00:26 +01:00
fix: add replies in parallel during note assertion
This commit is contained in:
@@ -248,18 +248,16 @@ Notes.assert = async (uid, input, options = { skipChecks: false }) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const post of unprocessed) {
|
await Promise.all(unprocessed.map(async (post) => {
|
||||||
const { to, cc } = post._activitypub;
|
const { to, cc } = post._activitypub;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// eslint-disable-next-line no-await-in-loop
|
|
||||||
await topics.reply(post);
|
await topics.reply(post);
|
||||||
// eslint-disable-next-line no-await-in-loop
|
|
||||||
await Notes.updateLocalRecipients(post.pid, { to, cc });
|
await Notes.updateLocalRecipients(post.pid, { to, cc });
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
activitypub.helpers.log(`[activitypub/notes.assert] Could not add reply (${post.pid}): ${e.message}`);
|
activitypub.helpers.log(`[activitypub/notes.assert] Could not add reply (${post.pid}): ${e.message}`);
|
||||||
}
|
}
|
||||||
}
|
}));
|
||||||
|
|
||||||
await Notes.syncUserInboxes(tid, uid);
|
await Notes.syncUserInboxes(tid, uid);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user