mirror of
https://github.com/mailgun/groupcache.git
synced 2024-11-16 14:10:04 +00:00
Merge pull request #17 from derekperkins/patch-1
fix goroutine race condition
This commit is contained in:
commit
7dd8e405d0
@ -265,10 +265,10 @@ func (g *Group) Remove(ctx context.Context, key string) error {
|
||||
}
|
||||
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
go func(peer ProtoGetter) {
|
||||
errs <- g.removeFromPeer(ctx, peer, key)
|
||||
wg.Done()
|
||||
}()
|
||||
}(peer)
|
||||
}
|
||||
go func() {
|
||||
wg.Wait()
|
||||
|
Loading…
Reference in New Issue
Block a user