mirror of https://github.com/tidwall/tile38.git
Always OK for leader
This commit is contained in:
parent
30c3e81e0d
commit
27335c37f1
|
@ -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) {
|
func (s *Server) cmdHealthz(msg *Message) (res resp.Value, err error) {
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
// if s.config.followHost() != "" {
|
if s.config.followHost() != "" {
|
||||||
m := make(map[string]interface{})
|
m := make(map[string]interface{})
|
||||||
s.basicStats(m)
|
s.basicStats(m)
|
||||||
if fmt.Sprintf("%v\n", m["caught_up"]) != "true" {
|
if fmt.Sprintf("%v\n", m["caught_up"]) != "true" {
|
||||||
return NOMessage, errors.New("not caught up")
|
return NOMessage, errors.New("not caught up")
|
||||||
}
|
}
|
||||||
// }
|
}
|
||||||
switch msg.OutputType {
|
switch msg.OutputType {
|
||||||
case JSON:
|
case JSON:
|
||||||
res = resp.StringValue(`{"ok":true,"elapsed":"` + time.Since(start).String() + "\"}")
|
res = resp.StringValue(`{"ok":true,"elapsed":"` + time.Since(start).String() + "\"}")
|
||||||
|
|
Loading…
Reference in New Issue