- only clear sync status when SkuShopCategoryMap succeeded

- and DetailErrList for tasksch.
This commit is contained in:
gazebo
2018-10-27 10:22:25 +08:00
parent 0397729aa0
commit 970e8dc7b2
4 changed files with 24 additions and 9 deletions

View File

@@ -126,6 +126,9 @@ func (task *ParallelTask) Run() {
chanRetVal = err
goto end
}
task.locker.Lock()
task.DetailErrList = append(task.DetailErrList, err)
task.locker.Unlock()
}
}
}
@@ -176,9 +179,8 @@ func (task *ParallelTask) Run() {
task.Result = taskResult
task.TerminatedAt = time.Now()
task.locker.Unlock()
globals.SugarLogger.Debugf("ParallelTask.Run %s, result:%v, err:%v", task.Name, taskResult, taskErr)
globals.SugarLogger.Debugf("ParallelTask.Run %s, err:%v", task.Name, taskErr)
// globals.SugarLogger.Debugf("ParallelTask.Run %s, result:%v, err:%v", task.Name, taskResult, taskErr)
close(task.subFinishChan)
if task.resultHandler != nil {

View File

@@ -45,6 +45,9 @@ func (task *SeqTask) Run() {
if !task.IsContinueWhenError {
break
}
task.locker.Lock()
task.DetailErrList = append(task.DetailErrList, err)
task.locker.Unlock()
} else if result != nil {
taskResult = append(taskResult, utils.Interface2Slice(result)...)
}

View File

@@ -61,9 +61,10 @@ type BaseTask struct {
FailedJobCount int `json:"failedJobCount"`
Status int `json:"status"`
Result []interface{} `json:"result"`
Err error `json:"err"`
Children TaskList `json:"children"`
Result []interface{} `json:"result"`
Err error `json:"err"`
Children TaskList `json:"children"`
DetailErrList []error `json:"detailErrList"`
finishChan chan int
C <-chan int `json:"-"`