MCPcopy Create free account
hub / github.com/CreminiAI/skillpack / createCronTask

Method createCronTask

src/runtime/adapters/scheduler.ts:567–582  ·  view source on GitHub ↗
(jobConfig: ScheduledJobConfig)

Source from the content-addressed store, hash-verified

565 job.task?.stop();
566 }
567 this.jobs.clear();
568 console.log("[SchedulerAdapter] All jobs stopped.");
569 }
570
571 private createCronTask(jobConfig: ScheduledJobConfig): ReturnType<typeof cron.schedule> {
572 const cronExpr = normalizeJobCron(jobConfig.cron);
573 if (!cronExpr) {
574 throw new Error(`Job "${jobConfig.name}" does not have a valid cron expression`);
575 }
576
577 return cron.schedule(
578 cronExpr,
579 () => {
580 void this.runJob(jobConfig);
581 },
582 {
583 timezone: jobConfig.timezone,
584 },
585 );

Callers 2

registerJobMethod · 0.95
setEnabledMethod · 0.95

Calls 2

runJobMethod · 0.95
normalizeJobCronFunction · 0.85

Tested by

no test coverage detected