Optimize polling performance and reduce memory usage

- Reduce polling attempts from 10 to 5 with 3-second timeout protection
- Optimize exponential backoff delays (25ms-400ms vs 50ms-2000ms)
- Remove memory-intensive unique keys from job creation
- Reduce ensureEmailJob retry attempts from 5 to 3
- Use gentler exponential backoff (1.5x vs 2x) capped at 200ms
- Rely on database constraints for duplicate prevention instead of memory keys

Performance improvements:
- Faster response times for immediate email sending
- Reduced memory bloat in job queue systems
- Better resource efficiency for high-volume scenarios

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-09-14 21:41:29 +02:00
parent e28ee6b358
commit 8135ff61c2
3 changed files with 25 additions and 21 deletions

View File

@@ -9,10 +9,6 @@ export interface ProcessEmailJobInput {
* The ID of the email to process
*/
emailId: string | number
/**
* Optional unique constraint helper to prevent duplicate jobs
*/
uniqueKey?: string
}
/**