Skip to content

Commit

Permalink
fix: codis-dashboard uses 100% cpu(OpenAtomFoundation#2332) (OpenAtom…
Browse files Browse the repository at this point in the history
…Foundation#2393)

Co-authored-by: liuchengyu <liuchengyu@360.cn>
  • Loading branch information
chengyu-l and liuchengyu authored Feb 7, 2024
1 parent 2ad20e6 commit 44e7778
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))
}

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

0 comments on commit 44e7778

Please sign in to comment.