Skip to content

Commit

Permalink
fix: codis-dashboard uses 100% cpu(#2332)
Browse files Browse the repository at this point in the history
  • Loading branch information
liuchengyu committed Feb 5, 2024
1 parent 3be4d52 commit e3fef04
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion codis/pkg/proxy/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,13 @@ func init() {
// Clear the accumulated maximum delay to 0
go func() {
for {
time.Sleep(time.Duration(RefreshPeriod.Int64()))
refreshPeriod := RefreshPeriod.Int64()
if refreshPeriod == 0 {
time.Sleep(15 * time.Second)
} else {
time.Sleep(time.Duration(RefreshPeriod.Int64()))
}

for _, s := range cmdstats.opmap {
s.maxDelay.Set(0)
}
Expand Down

0 comments on commit e3fef04

Please sign in to comment.