Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6a184933d1 |
@@ -110,8 +110,13 @@ func (c *ConsulMon) healthCheck(service string) (bool, error) {
|
|||||||
}
|
}
|
||||||
for _, nodeInfo := range data {
|
for _, nodeInfo := range data {
|
||||||
n := nodeInfo.(map[string]interface{})
|
n := nodeInfo.(map[string]interface{})
|
||||||
if n["Node"] == c.node && n["Status"].(string) == "passing" {
|
if n["Node"] == c.node {
|
||||||
return true, nil
|
if n["Status"].(string) == "passing" {
|
||||||
|
return true, nil
|
||||||
|
} else {
|
||||||
|
glog.V(2).Infof("Consul Healthcheck returned %s status", n["Status"].(string))
|
||||||
|
return false, nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false, fmt.Errorf("No healcheck info found for node %s in consul", c.node)
|
return false, fmt.Errorf("No healcheck info found for node %s in consul", c.node)
|
||||||
|
|||||||
Reference in New Issue
Block a user