updates
This commit is contained in:
@@ -2,18 +2,28 @@ import { scheduleEOIReminders } from '~/server/tasks/eoi-reminders';
|
||||
import { scheduleEmailProcessing } from '~/server/tasks/process-sales-emails';
|
||||
|
||||
export default defineNitroPlugin((nitroApp) => {
|
||||
console.log('[Plugin] Initializing automated tasks...');
|
||||
|
||||
// Schedule EOI reminders when server starts
|
||||
console.log('[Plugin] Initializing EOI reminder scheduler...');
|
||||
|
||||
// Add a small delay to ensure all services are ready
|
||||
setTimeout(() => {
|
||||
scheduleEOIReminders();
|
||||
setTimeout(async () => {
|
||||
try {
|
||||
await scheduleEOIReminders();
|
||||
} catch (error) {
|
||||
console.error('[Plugin] Failed to schedule EOI reminders:', error);
|
||||
}
|
||||
}, 5000);
|
||||
|
||||
// Schedule email processing for EOI attachments
|
||||
console.log('[Plugin] Initializing email processing scheduler...');
|
||||
|
||||
setTimeout(() => {
|
||||
scheduleEmailProcessing();
|
||||
setTimeout(async () => {
|
||||
try {
|
||||
await scheduleEmailProcessing();
|
||||
} catch (error) {
|
||||
console.error('[Plugin] Failed to schedule email processing:', error);
|
||||
}
|
||||
}, 7000);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user