Skip to content

Commit 546955a

Browse files
committed
fix(email): cache timeout results in MX check to prevent repeated 5s waits
1 parent 9e65099 commit 546955a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

apps/sim/lib/messaging/email/validation.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ export async function isDisposableMxBackend(email: string): Promise<boolean> {
138138
mxCache.set(domain, { result: result.isDisposableBackend, expires: now + 5 * 60 * 1000 })
139139
return result.isDisposableBackend
140140
} catch {
141+
mxCache.set(domain, { result: false, expires: now + 60 * 1000 })
141142
return false
142143
} finally {
143144
clearTimeout(timeoutId)

0 commit comments

Comments
 (0)