Skip to content

Commit

Permalink
fix(cache): fix get cache groups
Browse files Browse the repository at this point in the history
  • Loading branch information
id committed May 22, 2020
1 parent 11d4487 commit d1b2e6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ func (c *SyncCacheClient) AddCacheGroup(cacheGroupName string, getterFunc Getter
}

func (c *SyncCacheClient) GetCacheGroup(cacheGroupName string) *CacheGroup {
c.cacheGroupManager.RUnlock()
c.cacheGroupManager.RLock()
g := c.cacheGroupManager.cacheGroups[cacheGroupName]
c.cacheGroupManager.RUnlock()
return g
}

func (c *SyncCacheClient) GetCacheGroups() map[string]*CacheGroup {
c.cacheGroupManager.RUnlock()
c.cacheGroupManager.RLock()
g := c.cacheGroupManager.cacheGroups
c.cacheGroupManager.RUnlock()
return g
Expand Down

0 comments on commit d1b2e6c

Please sign in to comment.