MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / bootstrapTasks

Function bootstrapTasks

acron/acron.ts:453–465  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

451}
452
453async function bootstrapTasks() {
454 try {
455 const db = await getDB();
456 for (const t of db.data.tasks) {
457 // 跳过无效表达式
458 if (!cron.validateCronExpression(t.cron).valid) continue;
459 if (t.disabled) continue;
460 await scheduleTask(t);
461 }
462 } catch (e) {
463 console.error("[acron] bootstrap 失败:", e);
464 }
465}
466
467// 启动时注册历史任务(异步,不阻塞加载)
468bootstrapTasks();

Callers 1

acron.tsFile · 0.70

Calls 3

errorMethod · 0.80
getDBFunction · 0.70
scheduleTaskFunction · 0.70

Tested by

no test coverage detected