@@ -17,7 +17,7 @@ import (
|
|||||||
"github.com/astaxie/beego"
|
"github.com/astaxie/beego"
|
||||||
"github.com/george518/PPGo_Job/jobs"
|
"github.com/george518/PPGo_Job/jobs"
|
||||||
"github.com/george518/PPGo_Job/models"
|
"github.com/george518/PPGo_Job/models"
|
||||||
"github.com/robfig/cron"
|
"github.com/george518/PPGo_Job/crons"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TaskController struct {
|
type TaskController struct {
|
||||||
@@ -248,6 +248,10 @@ func (self *TaskController) AjaxSave() {
|
|||||||
self.ajaxMsg("含有禁止命令:"+msg, MSG_ERR)
|
self.ajaxMsg("含有禁止命令:"+msg, MSG_ERR)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if _, err := cron.Parse(task.CronSpec); err != nil {
|
||||||
|
self.ajaxMsg("cron表达式无效", MSG_ERR)
|
||||||
|
}
|
||||||
|
|
||||||
if err := task.Update(); err != nil {
|
if err := task.Update(); err != nil {
|
||||||
self.ajaxMsg(err.Error(), MSG_ERR)
|
self.ajaxMsg(err.Error(), MSG_ERR)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user