Skip to content

Commit

Permalink
skip insertAllExchanges on empty exchanges
Browse files Browse the repository at this point in the history
  • Loading branch information
bbohec committed Jul 10, 2023
1 parent be83383 commit 35726e1
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@ export class PgDiscussionAggregateRepository
discussionId: DiscussionId,
exchanges: ExchangeEntity[],
) {
if (exchanges.length === 0) {
logger.info(
{ discussionId },
"PgDiscussionAggregateRepository_insertAllExchanges_SkipNoExchanges",
);
return;
}
const query = `
INSERT INTO exchanges (discussion_id, message, sender, recipient, sent_at, subject)
VALUES %L
Expand Down

0 comments on commit 35726e1

Please sign in to comment.