updates
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
import cron from 'node-cron';
|
||||
import { getInterests } from '~/server/utils/nocodb';
|
||||
import { checkDocumentSignatureStatus } from '~/server/utils/documeso';
|
||||
|
||||
// Track if tasks are already scheduled
|
||||
let tasksScheduled = false;
|
||||
|
||||
export function scheduleEOIReminders() {
|
||||
export async function scheduleEOIReminders() {
|
||||
if (tasksScheduled) {
|
||||
console.log('[EOI Reminders] Tasks already scheduled');
|
||||
return;
|
||||
@@ -13,6 +12,9 @@ export function scheduleEOIReminders() {
|
||||
|
||||
console.log('[EOI Reminders] Scheduling reminder tasks...');
|
||||
|
||||
// Dynamic import for node-cron to avoid ESM issues
|
||||
const cron = await import('node-cron');
|
||||
|
||||
// Schedule for 9am daily
|
||||
cron.schedule('0 9 * * *', async () => {
|
||||
console.log('[EOI Reminders] Running 9am reminder check...');
|
||||
|
||||
Reference in New Issue
Block a user