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:52:52 +08:00
parent 9d04c2e300
commit a3a562a632

View File

@ -691,7 +691,8 @@ func (scheduler *SchedulerFair) Stop(jobName string) MsgStop {
if index != -1 { if index != -1 {
(&scheduler.queues[queue][index]).Status = Stopped (&scheduler.queues[queue][index]).Status = Stopped
scheduler.historyMu.Lock() scheduler.historyMu.Lock()
scheduler.history = append(scheduler.history, &scheduler.queues[queue][index]) job := scheduler.queues[queue][index]
scheduler.history = append(scheduler.history, &job)
scheduler.historyMu.Unlock() scheduler.historyMu.Unlock()
copy(scheduler.queues[queue][index:], scheduler.queues[queue][index+1:]) copy(scheduler.queues[queue][index:], scheduler.queues[queue][index+1:])
scheduler.queues[queue] = scheduler.queues[queue][:len(scheduler.queues[queue])-1] scheduler.queues[queue] = scheduler.queues[queue][:len(scheduler.queues[queue])-1]