mirror of
https://github.com/mailgun/groupcache.git
synced 2024-11-19 05:13:57 +00:00
fix goroutine race condition
This commit is contained in:
parent
ba255c644a
commit
3f29740e18
@ -265,10 +265,10 @@ func (g *Group) Remove(ctx context.Context, key string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
go func() {
|
go func(peer string) {
|
||||||
errs <- g.removeFromPeer(ctx, peer, key)
|
errs <- g.removeFromPeer(ctx, peer, key)
|
||||||
wg.Done()
|
wg.Done()
|
||||||
}()
|
}(peer)
|
||||||
}
|
}
|
||||||
go func() {
|
go func() {
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
|
Loading…
Reference in New Issue
Block a user