feat: implement cron expression support for scheduled tasks

This commit is contained in:
DBT
2026-02-12 08:44:36 +00:00
parent ef3f61d9fe
commit 8f3340e1de
3 changed files with 61 additions and 0 deletions

View File

@@ -208,6 +208,15 @@ func (cs *CronService) computeNextRun(schedule *CronSchedule, nowMS int64) *int6
return &next
}
if schedule.Kind == "cron" && schedule.Expr != "" {
parser := NewSimpleCronParser(schedule.Expr)
next := parser.Next(time.UnixMilli(nowMS))
if !next.IsZero() {
ms := next.UnixMilli()
return &ms
}
}
return nil
}