Skip to content

Commit

Permalink
address the comment
Browse files Browse the repository at this point in the history
Signed-off-by: yisaer <disxiaofei@163.com>
  • Loading branch information
Yisaer committed May 14, 2021
1 parent 55cff6f commit 5ecebae
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server/statistics/hot_peer_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,10 @@ func (f *hotPeerCache) CollectExpiredItems(region *core.RegionInfo) []*HotPeerSt

// CheckPeerFlow checks the flow information of a peer.
// Notice: CheckPeerFlow couldn't be used concurrently.
// CheckPeerFlow will update oldItem's rollingLoads into newItem, thus we should use write lock here.
func (f *hotPeerCache) CheckPeerFlow(peer *core.PeerInfo, region *core.RegionInfo) *HotPeerStat {
f.RLock()
defer f.RUnlock()
f.Lock()
defer f.Unlock()
interval := peer.GetInterval()
if Denoising && interval < HotRegionReportMinInterval {
return nil
Expand Down

0 comments on commit 5ecebae

Please sign in to comment.