- RefreshAllStoresID
- RefreshAllSkusID - use new tasksch when possible(not use run directly).
This commit is contained in:
@@ -193,7 +193,7 @@ func (task *ParallelTask) Run() {
|
||||
})
|
||||
}
|
||||
|
||||
func (t *ParallelTask) AddChild(task ITask) {
|
||||
t.BaseTask.AddChild(task)
|
||||
func (t *ParallelTask) AddChild(task ITask) ITask {
|
||||
task.SetParent(t)
|
||||
return t.BaseTask.AddChild(task)
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ func (task *SeqTask) Run() {
|
||||
})
|
||||
}
|
||||
|
||||
func (t *SeqTask) AddChild(task ITask) {
|
||||
t.BaseTask.AddChild(task)
|
||||
func (t *SeqTask) AddChild(task ITask) ITask {
|
||||
task.SetParent(t)
|
||||
return t.BaseTask.AddChild(task)
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ type ITask interface {
|
||||
GetStatus() int
|
||||
GetCreatedAt() time.Time
|
||||
|
||||
AddChild(task ITask)
|
||||
AddChild(task ITask) ITask
|
||||
GetChildren() TaskList
|
||||
SetParent(parentTask ITask)
|
||||
|
||||
@@ -182,11 +182,12 @@ func (t *BaseTask) GetStatus() int {
|
||||
return t.Status
|
||||
}
|
||||
|
||||
func (t *BaseTask) AddChild(task ITask) {
|
||||
func (t *BaseTask) AddChild(task ITask) ITask {
|
||||
t.locker.Lock()
|
||||
defer t.locker.Unlock()
|
||||
|
||||
t.Children = append(t.Children, task)
|
||||
return task
|
||||
}
|
||||
|
||||
func (t *BaseTask) GetChildren() (children TaskList) {
|
||||
|
||||
Reference in New Issue
Block a user