From: Tom Clegg Date: Wed, 28 Jul 2021 22:22:08 +0000 (-0400) Subject: 17574: Fix wait on empty channel. X-Git-Tag: 2.3.0~118^2~5 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/0ca9b2d72645e10276fe56347c63867f166419e4 17574: Fix wait on empty channel. Arvados-DCO-1.1-Signed-off-by: Tom Clegg --- diff --git a/services/keep-balance/collection.go b/services/keep-balance/collection.go index daedeb8bfc..575aa0c39c 100644 --- a/services/keep-balance/collection.go +++ b/services/keep-balance/collection.go @@ -239,8 +239,8 @@ func (bal *Balancer) updateCollections(ctx context.Context, c *arvados.Client, c } wg.Wait() bal.logf("updated %d collections", updated) - if err := <-errs; err != nil { - return fmt.Errorf("error updating collections: %s", err) + if len(errs) > 0 { + return fmt.Errorf("error updating collections: %s", <-errs) } return nil }