Skip to content

Commit

Permalink
resolve disksing's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
atmzhou committed Sep 18, 2017
1 parent 153606b commit cf482f0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions store/tikv/region_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,8 @@ func (c *RegionCache) insertRegionToCache(r *Region) *Region {

// getRegionByIDFromCache tries to get region by regionID from cache
func (c *RegionCache) getRegionByIDFromCache(regionID uint64) *Region {
c.mu.RLock()
defer c.mu.RUnlock()
for v, r := range c.mu.regions {
if v.id == regionID {
return r.region
Expand Down

0 comments on commit cf482f0

Please sign in to comment.