Merge pull request #15 from inhuman/master

DeregisterGroup
This commit is contained in:
Derrick J. Wippler 2020-07-08 11:45:42 -05:00 committed by GitHub
commit 26cd2cefd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {