Merge pull request #186 from cloudflare/sven/remove-unneeded-async

remove uneeded async closure
pull/194/head
Sven Sauleau 2023-02-03 16:58:18 +00:00 zatwierdzone przez GitHub
commit c1aa5bb49a
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 12 dodań i 14 usunięć

Wyświetl plik

@ -48,21 +48,19 @@ export async function deliverFollowers(
return return
} }
const messages: Array<MessageSendRequest<DeliverMessageBody>> = await Promise.all( const messages: Array<MessageSendRequest<DeliverMessageBody>> = followers.map((id) => {
followers.map(async (id) => { const body = {
const body = { // Make sure the object is supported by `structuredClone()`, ie
// Make sure the object is supported by `structuredClone()`, ie // removing the URL objects as they aren't clonabled.
// removing the URL objects as they aren't clonabled. activity: JSON.parse(JSON.stringify(activity)),
activity: JSON.parse(JSON.stringify(activity)),
actorId: from.id.toString(), actorId: from.id.toString(),
toActorId: id, toActorId: id,
type: MessageType.Deliver, type: MessageType.Deliver,
userKEK, userKEK,
} }
return { body } return { body }
}) })
)
await queue.sendBatch(messages) await queue.sendBatch(messages)
} }