]> Cypherpunks.ru repositories - nncp.git/commitdiff
Wait for goroutine completion and error logging when tossing
authorSergey Matveev <stargrave@stargrave.org>
Thu, 8 Jul 2021 10:07:06 +0000 (13:07 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Thu, 8 Jul 2021 10:07:06 +0000 (13:07 +0300)
src/toss.go

index 69ad45536e2ba0427e2ba90b5b9d104e6b924301..e5e3487c8bba60aceabad445ea2b913fccb460c1 100644 (file)
@@ -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 {