task: fix concurrent write

This commit is contained in:
arm64v8a 2023-09-29 20:13:45 +09:00
parent ce9dfad347
commit 1bcf7e8a13

View file

@ -88,9 +88,11 @@ func (g *Group) RunContextList(contextList []context.Context) error {
selectedContext, upstreamErr := common.SelectContext(append([]context.Context{taskCancelContext}, contextList...)) selectedContext, upstreamErr := common.SelectContext(append([]context.Context{taskCancelContext}, contextList...))
if selectedContext != 0 { if selectedContext != 0 {
errorAccess.Lock()
returnError = E.Append(returnError, upstreamErr, func(err error) error { returnError = E.Append(returnError, upstreamErr, func(err error) error {
return E.Cause(err, "upstream") return E.Cause(err, "upstream")
}) })
errorAccess.Unlock()
} }
if g.cleanup != nil { if g.cleanup != nil {