refactor: restructure main function and setInterval for better readability and execution flow

This commit is contained in:
2026-02-28 00:03:11 +01:00
parent a29bceda4e
commit 7a08a63db3

View File

@@ -26,8 +26,7 @@ async function getTimetabe() {
return timetable;
}
setInterval(async () => {
async function main() {
const timetable = await getTimetabe();
if (!timetable || timetable.length === 0) {
@@ -138,5 +137,10 @@ setInterval(async () => {
}
console.log(`✅ Sync done — Created: ${created}, Updated: ${updated}, Skipped: ${skipped}`);
}
main();
setInterval(async () => {
await main();
}, 1000 * 60 * 30); // Alle 30 Minuten aktualisieren