feat: initialize CalBook project with comprehensive scheduling, admin, and deployment infrastructure

This commit is contained in:
2026-05-07 13:04:02 +02:00
parent 51acfe9488
commit ee48a93824
133 changed files with 26049 additions and 0 deletions

24
lib/services/cron.ts Normal file
View File

@@ -0,0 +1,24 @@
import cron from "node-cron";
import { syncAllEnabledCalendars } from "@/lib/services/caldav";
import { runAppointmentReminders } from "@/lib/services/reminders";
let started = false;
export function startSyncCron() {
if (started || process.env.NODE_ENV === "test") return;
started = true;
cron.schedule("*/5 * * * *", async () => {
try {
await Promise.all([
syncAllEnabledCalendars(),
runAppointmentReminders()
]);
// eslint-disable-next-line no-console
console.log("[calbook] CalDAV Sync ausgeführt");
} catch (error) {
// eslint-disable-next-line no-console
console.error("[calbook] CalDAV Sync Fehler", error);
}
});
}