Skip to content

Commit

Permalink
Merge pull request #15 from inhuman/master
Browse files Browse the repository at this point in the history
DeregisterGroup
  • Loading branch information
thrawn01 authored Jul 8, 2020
2 parents 7dd8e40 + f06dad8 commit 26cd2ce
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions groupcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ func NewGroup(name string, cacheBytes int64, getter Getter) *Group {
return newGroup(name, cacheBytes, getter, nil)
}

// DeregisterGroup removes group from group pool
func DeregisterGroup(name string) {
mu.Lock()
delete(groups, name)
mu.Unlock()
}

// If peers is nil, the peerPicker is called via a sync.Once to initialize it.
func newGroup(name string, cacheBytes int64, getter Getter, peers PeerPicker) *Group {
if getter == nil {
Expand Down

0 comments on commit 26cd2ce

Please sign in to comment.