- optimize tasksch channel.

This commit is contained in:
gazebo
2018-10-21 17:09:08 +08:00
parent 0fb6fe27fe
commit c818c45a4d
3 changed files with 12 additions and 17 deletions

View File

@@ -57,9 +57,6 @@ func (task *SeqTask) Run() {
}
EndFor:
task.locker.Lock()
if task.Status != TaskStatusCanceling {
close(task.quitChan)
}
if taskErr != nil { // 如果有错误,肯定就是失败了
task.Status = TaskStatusFailed
} else {
@@ -76,8 +73,6 @@ func (task *SeqTask) Run() {
task.locker.Unlock()
globals.SugarLogger.Debugf("SeqTask.Run %s, result:%v, err:%v", task.Name, taskResult, taskErr)
close(task.finishChan)
})
}