diff --git a/pkg/cluster/cluster.go b/pkg/cluster/cluster.go index 0aa011fb6b14..bc89c9e98068 100644 --- a/pkg/cluster/cluster.go +++ b/pkg/cluster/cluster.go @@ -35,8 +35,9 @@ type Cluster interface { func HandleStatsAsync(c Cluster, region *core.RegionInfo) { c.GetHotStat().CheckWriteAsync(statistics.NewCheckExpiredItemTask(region)) c.GetHotStat().CheckReadAsync(statistics.NewCheckExpiredItemTask(region)) - interval := region.GetInterval() - c.GetHotStat().CheckWriteAsync(statistics.NewCheckPeerTask(region, region.GetWriteLoads(), interval.GetEndTimestamp()-interval.GetStartTimestamp())) + reportInterval := region.GetInterval() + interval := reportInterval.GetEndTimestamp() - reportInterval.GetStartTimestamp() + c.GetHotStat().CheckWriteAsync(statistics.NewCheckPeerTask(region, region.GetWriteLoads(), interval)) c.GetCoordinator().GetSchedulersController().CheckTransferWitnessLeader(region) }