1
0
mirror of https://github.com/newnius/YAO-scheduler.git synced 2025-06-07 14:21:55 +00:00
This commit is contained in:
Newnius 2020-06-18 20:25:40 +08:00
parent 883d16d4c6
commit 8b9386b2f5

View File

@ -676,7 +676,9 @@ func (scheduler *SchedulerFair) Stop(jobName string) MsgStop {
scheduler.queuesMu.Lock()
jm, ok := scheduler.jobs[jobName]
scheduler.queuesMu.Unlock()
if !ok {
if ok {
return jm.stop(true)
} else {
found := false
for queue := range scheduler.queues {
index := -1
@ -696,11 +698,11 @@ func (scheduler *SchedulerFair) Stop(jobName string) MsgStop {
break
}
}
if !found {
return MsgStop{Code: 1, Error: "Job not exist!"}
if found {
return MsgStop{Code: 0}
}
}
return jm.stop(true)
return MsgStop{Code: 1, Error: "Job not exist!"}
}
func (scheduler *SchedulerFair) QueryLogs(jobName string, taskName string) MsgLog {