diff --git a/common/task/task.go b/common/task/task.go index b2bb7cf..a7fb4a7 100644 --- a/common/task/task.go +++ b/common/task/task.go @@ -56,7 +56,7 @@ func (g *Group) RunContextList(contextList []context.Context) error { } taskContext, taskFinish := common.ContextWithCancelCause(context.Background()) - taskCancelContext, taskCancel := common.ContextWithCancelCause(context.Background()) + taskCancelContext, taskCancel := common.ContextWithCancelCause(contextList[0]) var errorAccess sync.Mutex var returnError error @@ -88,10 +88,6 @@ func (g *Group) RunContextList(contextList []context.Context) error { selectedContext, upstreamErr := common.SelectContext(append([]context.Context{taskCancelContext}, contextList...)) - if selectedContext == 0 { - taskCancel(upstreamErr) - } - if g.cleanup != nil { g.cleanup() }