diff --git a/src/eosapi/functions.go b/src/eosapi/functions.go index 3f93827..02558dc 100644 --- a/src/eosapi/functions.go +++ b/src/eosapi/functions.go @@ -74,8 +74,8 @@ func GetHealth(params ReqParams) (Health, error) { resp := r.Response() body, _ := ioutil.ReadAll(resp.Body) - // Set HTTPStatusCode - health.HTTPStatusCode = resp.StatusCode + // Set HTTPStatusCode + health.HTTPStatusCode = resp.StatusCode // Parse json err = json.Unmarshal(body, &health) diff --git a/src/server.go b/src/server.go index 507034e..b23b7d7 100644 --- a/src/server.go +++ b/src/server.go @@ -56,11 +56,11 @@ func check_api_v2(p eosapi.ReqParams, offset int64) (haproxy.HealthCheckStatus, return haproxy.HealthCheckFailed, msg } - // Check HTTP Status Code - if health.HTTPStatusCode > 299 { + // Check HTTP Status Code + if health.HTTPStatusCode > 299 { return haproxy.HealthCheckDown, fmt.Sprintf("Taking offline because %v was received from backend", health.HTTPStatusCode) - } + } // Fetch elasticsearch and nodeos block numbers from json. var es_block int64 = 0