Skip to content

Commit

Permalink
chore: try assync handle processMessages with promise.all
Browse files Browse the repository at this point in the history
  • Loading branch information
OtacilioN committed Sep 3, 2024
1 parent 314274e commit 01af099
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/processors/slicers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ Basta escrever o que você deseja ✍️`
const processValue = async (value: { messages: any[]; contacts: any }, businessId: string) => {
const { contacts, messages } = value;
if (messages) {
for (const message of messages) {
await processMessages({ message, contacts });
}
await Promise.all(
messages.map(async (message) => {
await processMessages({ message, contacts });
})
);
}
};

Expand Down

0 comments on commit 01af099

Please sign in to comment.