Skip to content

Commit 0efa2d2

Browse files
committed
client: reuse group instead of diy'ing it
1 parent 134c047 commit 0efa2d2

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

client/client.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -575,15 +575,11 @@ func (c *Client) Shutdown() error {
575575
}
576576
} else {
577577
// In normal mode call shutdown
578-
wg := sync.WaitGroup{}
578+
arGroup := group{}
579579
for _, ar := range c.getAllocRunners() {
580-
wg.Add(1)
581-
go func(ar AllocRunner) {
582-
ar.Shutdown()
583-
wg.Done()
584-
}(ar)
580+
arGroup.Go(ar.Shutdown)
585581
}
586-
wg.Wait()
582+
arGroup.Wait()
587583
}
588584

589585
c.shutdown = true

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy