mirror of
https://github.com/lzh-1625/go_process_manager.git
synced 2025-10-05 16:06:51 +08:00
1
This commit is contained in:
@@ -57,10 +57,8 @@ func (r *Response) SetCode(code int) *Response {
|
||||
func (r *Response) SetMessage(msg any) *Response {
|
||||
if str, ok := msg.(string); ok {
|
||||
r.Msg = str
|
||||
} else {
|
||||
if err, ok := msg.(error); ok {
|
||||
r.Msg = err.Error()
|
||||
}
|
||||
} else if err, ok := msg.(error); ok {
|
||||
r.Msg = err.Error()
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
@@ -121,10 +121,8 @@ func (t *TaskJob) InitCronHandle() error {
|
||||
func (t *TaskJob) EditStatus(status bool) error {
|
||||
if t.Cron != nil && !status {
|
||||
t.Cron.Stop()
|
||||
} else {
|
||||
if err := t.InitCronHandle(); err != nil {
|
||||
return err
|
||||
}
|
||||
} else if err := t.InitCronHandle(); err != nil {
|
||||
return err
|
||||
}
|
||||
t.TaskConfig.Enable = status
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user