20 lines
626 B
TypeScript
20 lines
626 B
TypeScript
|
|
import { scheduleEOIReminders } from '~/server/tasks/eoi-reminders';
|
||
|
|
import { scheduleEmailProcessing } from '~/server/tasks/process-sales-emails';
|
||
|
|
|
||
|
|
export default defineNitroPlugin((nitroApp) => {
|
||
|
|
// 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();
|
||
|
|
}, 5000);
|
||
|
|
|
||
|
|
// Schedule email processing for EOI attachments
|
||
|
|
console.log('[Plugin] Initializing email processing scheduler...');
|
||
|
|
|
||
|
|
setTimeout(() => {
|
||
|
|
scheduleEmailProcessing();
|
||
|
|
}, 7000);
|
||
|
|
});
|