Skip to content

Commit

Permalink
More email retry logic
Browse files Browse the repository at this point in the history
  • Loading branch information
N2D4 committed Dec 12, 2024
1 parent ed66dd9 commit 6ecbdab
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apps/backend/src/lib/emails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ export async function sendEmail({
"450 ",
"Client network socket disconnected before secure TLS connection was established",
"Too many requests",
...emailConfig.host.includes("resend") ? [
// Resend is a bit unreliable, so we'll retry even in some cases where it may send duplicate emails
"ECONNRESET",
] : [],
];
if (temporaryErrorIndicators.some(indicator => error instanceof Error && error.message.includes(indicator))) {
// this can happen occasionally (especially with certain unreliable email providers)
Expand Down

0 comments on commit 6ecbdab

Please sign in to comment.