Skip to content

Commit e93028f

Browse files
chejingechengyu-lliuchengyu
authored
unstable->3.5 (#2396)
* fix: codis-dashboard uses 100% cpu(#2332) (#2393) Co-authored-by: liuchengyu <liuchengyu@360.cn> * fix: The role displayed on the first Server in the Group area of the codis-fe is incorrect (#2350) (#2387) Co-authored-by: liuchengyu <liuchengyu@360.cn> --------- Co-authored-by: Chengyu Liu <chengyu_l@126.com> Co-authored-by: liuchengyu <liuchengyu@360.cn>
1 parent 3be4d52 commit e93028f

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

codis/cmd/fe/assets/index.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,10 @@ <h4 style="padding-left:30px; padding-right:20px; display: inline;">Group</h4>
538538
</span>
539539
</td>
540540
<td>
541-
<a ng-href="http://[[codis_addr]]/api/topom/group/info/[[server.server]]" target="_blank" class="btn btn-default btn-xs active" role="button">S</a>
541+
<span ng-switch="$index">
542+
<a ng-switch-when="0" ng-href="http://[[codis_addr]]/api/topom/group/info/[[server.server]]" target="_blank" class="btn btn-default btn-xs active" role="button">Master</a>
543+
<a ng-switch-default ng-href="http://[[codis_addr]]/api/topom/group/info/[[server.server]]" target="_blank" class="btn btn-default btn-xs active" role="button">Slave</a>
544+
</span>
542545
<span ng-switch="server.ha_status">
543546
<span ng-switch-when="ha_master" style="color: darkgreen"
544547
data-toggle="tooltip" data-placement="right" title="HA: MASTER">

codis/pkg/proxy/stats.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,13 @@ func init() {
8585
// Clear the accumulated maximum delay to 0
8686
go func() {
8787
for {
88-
time.Sleep(time.Duration(RefreshPeriod.Int64()))
88+
refreshPeriod := RefreshPeriod.Int64()
89+
if refreshPeriod == 0 {
90+
time.Sleep(15 * time.Second)
91+
} else {
92+
time.Sleep(time.Duration(refreshPeriod))
93+
}
94+
8995
for _, s := range cmdstats.opmap {
9096
s.maxDelay.Set(0)
9197
}

0 commit comments

Comments
 (0)