mirror of
https://github.com/xtr-dev/payload-mailing.git
synced 2025-12-10 08:13:23 +00:00
Fix critical race conditions and performance issues
- Implement atomic check-and-create pattern in ensureEmailJob with exponential backoff - Fix import mismatch by exporting processJobById from index.ts - Enable database indexes for status+scheduledAt and priority+createdAt fields - Standardize string conversion for consistent ID handling throughout codebase - Fix TypeScript compilation errors in collection indexes and variable scope 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -226,20 +226,14 @@ const Emails: CollectionConfig = {
|
||||
]
|
||||
},
|
||||
timestamps: true,
|
||||
// indexes: [
|
||||
// {
|
||||
// fields: {
|
||||
// status: 1,
|
||||
// scheduledAt: 1,
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// fields: {
|
||||
// priority: -1,
|
||||
// createdAt: 1,
|
||||
// },
|
||||
// },
|
||||
// ],
|
||||
indexes: [
|
||||
{
|
||||
fields: ['status', 'scheduledAt'],
|
||||
},
|
||||
{
|
||||
fields: ['priority', 'createdAt'],
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
export default Emails
|
||||
|
||||
Reference in New Issue
Block a user