Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions nodejs/src/cdp/services/messaging/email.service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ describe('EmailService', () => {
// than the upper bound + scheduler overhead.
expect(scheduledMs).toBeGreaterThanOrEqual(before + 400)
expect(scheduledMs).toBeLessThan(before + 2000)
expect(result.invocation.queueParameters).toEqual(invocation.queueParameters)
// No business metric emitted on throttle — the eventual retry
// will produce email_sent.
expect(result.metrics ?? []).toEqual([])
Expand Down
1 change: 1 addition & 0 deletions nodejs/src/cdp/services/messaging/email.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,7 @@ export class EmailService {
// catches the cases where SES disagrees with our estimate.
throttled = true
result.finished = false
result.invocation.queueParameters = params
result.invocation.queueScheduledAt = DateTime.utc().plus({ milliseconds: error.retryAfterMs })
addLog('warn', `SES rate-limited (${error.errorCode}); rescheduling email in ${error.retryAfterMs}ms`)
} else {
Expand Down