mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #16755 from Juneezee/redundant-len-check
etcdserver: remove redundant `len` check in health check
This commit is contained in:
commit
3eca40d17c
@ -143,9 +143,8 @@ func getSerializableFlag(r *http.Request) bool {
|
||||
|
||||
func checkAlarms(lg *zap.Logger, srv ServerHealth, excludedAlarms AlarmSet) Health {
|
||||
h := Health{Health: "true"}
|
||||
as := srv.Alarms()
|
||||
if len(as) > 0 {
|
||||
for _, v := range as {
|
||||
|
||||
for _, v := range srv.Alarms() {
|
||||
alarmName := v.Alarm.String()
|
||||
if _, found := excludedAlarms[alarmName]; found {
|
||||
lg.Debug("/health excluded alarm", zap.String("alarm", v.String()))
|
||||
@ -164,7 +163,6 @@ func checkAlarms(lg *zap.Logger, srv ServerHealth, excludedAlarms AlarmSet) Heal
|
||||
lg.Warn("serving /health false due to an alarm", zap.String("alarm", v.String()))
|
||||
return h
|
||||
}
|
||||
}
|
||||
|
||||
return h
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user