mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-05-19 06:07:28 +08:00
cron web api: support kind=cron with expr for create/update
This commit is contained in:
@@ -245,6 +245,13 @@ func gatewayCmd() {
|
|||||||
at := int64(atMS)
|
at := int64(atMS)
|
||||||
schedule.AtMS = &at
|
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
|
deliver := false
|
||||||
if v, ok := args["deliver"].(bool); ok {
|
if v, ok := args["deliver"].(bool); ok {
|
||||||
deliver = v
|
deliver = v
|
||||||
@@ -288,6 +295,13 @@ func gatewayCmd() {
|
|||||||
s.AtMS = &at
|
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
|
in.Schedule = &s
|
||||||
}
|
}
|
||||||
return cronService.UpdateJob(id, in)
|
return cronService.UpdateJob(id, in)
|
||||||
|
|||||||
Reference in New Issue
Block a user