1
0
Fork 0
mirror of https://github.com/eosswedenorg/antelope-api-healthcheck synced 2026-07-04 12:03:43 +02:00

server.go: only log message if we have something interesting to show.

This commit is contained in:
Henrik Hautakoski 2020-02-07 07:37:28 +01:00
parent da5eef75d2
commit c33b355a78

View file

@ -151,8 +151,12 @@ func main() {
status, msg = check_api(host, port, float64(block_time)) status, msg = check_api(host, port, float64(block_time))
} }
fmt.Printf("[Status %s] %s:%d (%d blocks): %s, %s\n", fmt.Printf("[Status %s] %s:%d (%d blocks): %s\n",
version, host, port, block_time / 2, status, msg) version, host, port, block_time / 2, status)
if status != haproxy.HealthCheckUp && len(msg) > 0 {
fmt.Println(msg)
}
// Report status to HAproxy // Report status to HAproxy
c.Send(fmt.Sprintln(status)) c.Send(fmt.Sprintln(status))