Skip to content

Commit

Permalink
fix: Refactor message processing in SQSHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
paulo-tinoco committed Sep 26, 2024
1 parent d9abd98 commit 4ecea98
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/ext/sqs/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,13 @@ export class SQSHandler extends BaseSQS {
logging.info(
`Received ${messages.length} messages from queue ${this.provider.queueName}`
);
messages.forEach((message: any) => {
this.processMessage(message);
});
const promises = messages.map((message: any) =>
this.processMessage(message)
);
await Promise.all(promises);
}

this.callPoll();
await this.callPoll();
}

async callPoll(): Promise<void> {
Expand Down

0 comments on commit 4ecea98

Please sign in to comment.