From 27335c37f1b4c732451f6af273fd19ea6ef421bc Mon Sep 17 00:00:00 2001 From: tidwall Date: Tue, 25 May 2021 16:42:26 -0700 Subject: [PATCH] Always OK for leader --- internal/server/stats.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/server/stats.go b/internal/server/stats.go index 3706b5f5..ec90970f 100644 --- a/internal/server/stats.go +++ b/internal/server/stats.go @@ -97,13 +97,13 @@ func (s *Server) cmdStats(msg *Message) (res resp.Value, err error) { func (s *Server) cmdHealthz(msg *Message) (res resp.Value, err error) { start := time.Now() - // if s.config.followHost() != "" { - m := make(map[string]interface{}) - s.basicStats(m) - if fmt.Sprintf("%v\n", m["caught_up"]) != "true" { - return NOMessage, errors.New("not caught up") + if s.config.followHost() != "" { + m := make(map[string]interface{}) + s.basicStats(m) + if fmt.Sprintf("%v\n", m["caught_up"]) != "true" { + return NOMessage, errors.New("not caught up") + } } - // } switch msg.OutputType { case JSON: res = resp.StringValue(`{"ok":true,"elapsed":"` + time.Since(start).String() + "\"}")