fix: require async for deliver queue
All checks were successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline was successful
ci/woodpecker/pr/lint-sw Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/pr/lint-backend Pipeline was successful
ci/woodpecker/pr/lint-foundkey-js Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline was successful
All checks were successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline was successful
ci/woodpecker/pr/lint-sw Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/pr/lint-backend Pipeline was successful
ci/woodpecker/pr/lint-foundkey-js Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline was successful
This commit is contained in:
parent
7f7fbc291e
commit
e574d9cef1
10 changed files with 17 additions and 17 deletions
|
@ -29,7 +29,7 @@ export default define(meta, paramDef, async (ps, me) => {
|
|||
const actor = await getInstanceActor();
|
||||
const targetUser = await Users.findOneByOrFail({ id: report.targetUserId });
|
||||
|
||||
deliver(renderActivity(renderFlag(actor, report)), targetUser.inbox);
|
||||
await deliver(renderActivity(renderFlag(actor, report)), targetUser.inbox);
|
||||
}
|
||||
|
||||
await AbuseUserReports.update(report.id, {
|
||||
|
|
|
@ -133,7 +133,7 @@ export default define(meta, paramDef, async (ps, user) => {
|
|||
if (note.userHost != null) {
|
||||
const pollOwner = await Users.findOneByOrFail({ id: note.userId }) as IRemoteUser;
|
||||
|
||||
deliver(renderActivity(await renderVote(user, vote, note, poll, pollOwner)), pollOwner.inbox);
|
||||
await deliver(renderActivity(await renderVote(user, vote, note, poll, pollOwner)), pollOwner.inbox);
|
||||
}
|
||||
|
||||
// リモートフォロワーにUpdate配信
|
||||
|
|
|
@ -29,6 +29,6 @@ export default async function(blocker: User, blockee: User) {
|
|||
// deliver if remote bloking
|
||||
if (Users.isLocalUser(blocker) && Users.isRemoteUser(blockee)) {
|
||||
const content = renderActivity(renderUndo(renderBlock(blocking), blocker));
|
||||
deliver(content, blockee.inbox);
|
||||
await deliver(content, blockee.inbox);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ export async function acceptFollowRequest(followee: User, follower: User): Promi
|
|||
|
||||
if (Users.isRemoteUser(follower) && Users.isLocalUser(followee)) {
|
||||
const content = renderActivity(renderAccept(renderFollow(follower, followee, request.requestId!), followee));
|
||||
deliver(content, follower.inbox);
|
||||
await deliver(content, follower.inbox);
|
||||
}
|
||||
|
||||
Users.pack(followee.id, followee, {
|
||||
|
|
|
@ -17,7 +17,7 @@ export async function cancelFollowRequest(followee: User, follower: User): Promi
|
|||
const content = renderActivity(renderUndo(renderFollow(follower, followee), follower));
|
||||
|
||||
if (Users.isLocalUser(follower)) {
|
||||
deliver(content, followee.inbox);
|
||||
await deliver(content, followee.inbox);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -64,6 +64,6 @@ export async function createFollowRequest(follower: User, followee: User, reques
|
|||
|
||||
if (Users.isLocalUser(follower) && Users.isRemoteUser(followee)) {
|
||||
const content = renderActivity(renderFollow(follower, followee));
|
||||
deliver(content, followee.inbox);
|
||||
await deliver(content, followee.inbox);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ export async function createMessage(user: { id: User['id']; host: User['host'];
|
|||
|
||||
const activity = renderActivity(renderCreate(await renderNote(note, false, true), note));
|
||||
|
||||
deliver(activity, recipientUser.inbox);
|
||||
await deliver(activity, recipientUser.inbox);
|
||||
}
|
||||
return messageObj;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ async function postDeleteMessage(message: MessagingMessage): Promise<void> {
|
|||
|
||||
if (Users.isLocalUser(user) && Users.isRemoteUser(recipient)) {
|
||||
const activity = renderActivity(renderDelete(renderTombstone(`${config.url}/notes/${message.id}`), user));
|
||||
deliver(activity, recipient.inbox);
|
||||
await deliver(activity, recipient.inbox);
|
||||
}
|
||||
} else if (message.groupId) {
|
||||
publishGroupMessagingStream(message.groupId, 'deleted', message.id);
|
||||
|
|
|
@ -37,7 +37,7 @@ export async function addRelay(inbox: string): Promise<Relay> {
|
|||
|
||||
const relayActor = await getRelayActor();
|
||||
const activity = renderActivity(renderFollowRelay(relay, relayActor));
|
||||
deliver(activity, relay.inbox);
|
||||
await deliver(activity, relay.inbox);
|
||||
|
||||
return relay;
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ export async function removeRelay(inbox: string): Promise<void> {
|
|||
|
||||
const relayActor = await getRelayActor();
|
||||
const activity = renderActivity(renderUndo(renderFollowRelay(relay, relayActor), relayActor));
|
||||
deliver(activity, relay.inbox);
|
||||
await deliver(activity, relay.inbox);
|
||||
|
||||
await Relays.delete(relay.id);
|
||||
}
|
||||
|
@ -89,9 +89,9 @@ export async function deliverToRelays(user: { id: User['id']; host: null; }, act
|
|||
|
||||
const signed = await attachLdSignature(copy, user);
|
||||
|
||||
for (const relay of relays) {
|
||||
deliver(signed, relay.inbox);
|
||||
}
|
||||
await Promise.all(relays.map(relay =>
|
||||
deliver(signed, relay.inbox)
|
||||
));
|
||||
}
|
||||
|
||||
export async function deliverMultipleToRelays(user: User, activities: any[]): Promise<void> {
|
||||
|
@ -107,7 +107,7 @@ export async function deliverMultipleToRelays(user: User, activities: any[]): Pr
|
|||
return attachLdSignature(copy, user);
|
||||
}));
|
||||
|
||||
for (const relay of relays) {
|
||||
deliver(content, relay.inbox);
|
||||
}
|
||||
await Promise.all(relays.map(relay =>
|
||||
deliver(content, relay.inbox)
|
||||
));
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ export async function doPostUnsuspend(user: User): Promise<void> {
|
|||
}
|
||||
|
||||
for (const inbox of queue) {
|
||||
deliver(content, inbox);
|
||||
await deliver(content, inbox);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue