From: Sergey Matveev Date: Thu, 8 Jul 2021 10:07:06 +0000 (+0300) Subject: Wait for goroutine completion and error logging when tossing X-Git-Tag: v7.2.0^2~5 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=f8d9aac9b7c0a822972b7230edf25b7af287892a;p=nncp.git Wait for goroutine completion and error logging when tossing --- diff --git a/src/toss.go b/src/toss.go index 69ad455..e5e3487 100644 --- a/src/toss.go +++ b/src/toss.go @@ -820,7 +820,7 @@ func jobProcess( ) if err != nil { pipeW.CloseWithError(err) - go func() { <-errs }() + <-errs return err } pipeW.Close() @@ -955,7 +955,7 @@ func (ctx *Ctx) Toss( if err != nil { isBad = true fd.Close() - go func() { <-errs }() + <-errs continue } if err = <-errs; err == JobRepeatProcess {