This commit is contained in:
2025-06-10 14:05:09 +02:00
parent 218705da52
commit bd07939c3d
3 changed files with 22 additions and 10 deletions

View File

@@ -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...');