From a19ea16e61ebd306579e244ca3e1425c86148a4a Mon Sep 17 00:00:00 2001 From: chejinge <945997690@qq.com> Date: Wed, 7 Feb 2024 14:45:58 +0800 Subject: [PATCH] unstable->3.5 (#2396) * fix: codis-dashboard uses 100% cpu(#2332) (#2393) Co-authored-by: liuchengyu * fix: The role displayed on the first Server in the Group area of the codis-fe is incorrect (#2350) (#2387) Co-authored-by: liuchengyu --------- Co-authored-by: Chengyu Liu Co-authored-by: liuchengyu --- codis/cmd/fe/assets/index.html | 5 ++++- codis/pkg/proxy/stats.go | 8 +++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/codis/cmd/fe/assets/index.html b/codis/cmd/fe/assets/index.html index 023bf98c49..2524aa1fa2 100644 --- a/codis/cmd/fe/assets/index.html +++ b/codis/cmd/fe/assets/index.html @@ -538,7 +538,10 @@

Group

- S + + Master + Slave + diff --git a/codis/pkg/proxy/stats.go b/codis/pkg/proxy/stats.go index 06a2b67aa2..e157e31270 100644 --- a/codis/pkg/proxy/stats.go +++ b/codis/pkg/proxy/stats.go @@ -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) }