cron web api: support kind=cron with expr for create/update

This commit is contained in:
DBT
2026-02-25 16:11:46 +00:00
parent efddcdcb2e
commit 36ad6cf7f9

View File

@@ -245,6 +245,13 @@ func gatewayCmd() {
at := int64(atMS)
schedule.AtMS = &at
}
if kind == "cron" {
expr := getStr("expr")
if expr == "" {
return nil, fmt.Errorf("expr required for kind=cron")
}
schedule.Expr = expr
}
deliver := false
if v, ok := args["deliver"].(bool); ok {
deliver = v
@@ -288,6 +295,13 @@ func gatewayCmd() {
s.AtMS = &at
}
}
if kind == "cron" {
expr := getStr("expr")
if expr == "" {
return nil, fmt.Errorf("expr required for kind=cron")
}
s.Expr = expr
}
in.Schedule = &s
}
return cronService.UpdateJob(id, in)