17574: Fix wait on empty channel.
authorTom Clegg <tom@curii.com>
Wed, 28 Jul 2021 22:22:08 +0000 (18:22 -0400)
committerTom Clegg <tom@curii.com>
Wed, 28 Jul 2021 22:22:08 +0000 (18:22 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

services/keep-balance/collection.go

index daedeb8bfcb82b94fbf3007fd1f1a13fe19df432..575aa0c39c265eb64e79671b20b949f72a5cee98 100644 (file)
@@ -239,8 +239,8 @@ func (bal *Balancer) updateCollections(ctx context.Context, c *arvados.Client, c
        }
        wg.Wait()
        bal.logf("updated %d collections", updated)
        }
        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
 }
        }
        return nil
 }