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

src/api/v2.go: in LogInfo() skip "host" if it's zero length.

This commit is contained in:
Henrik Hautakoski 2022-02-21 13:10:56 +01:00
parent aa0b6998b8
commit 014027006f
No known key found for this signature in database
GPG key ID: 608414D93E862CCD

View file

@ -21,12 +21,18 @@ func NewEosioV2(params eosapi.ReqParams, offset int64) EosioV2 {
} }
func (e EosioV2) LogInfo() LogParams { func (e EosioV2) LogInfo() LogParams {
return LogParams{ p := LogParams{
"type", "eosio-v2", "type", "eosio-v2",
"url", e.params.Url, "url", e.params.Url,
"host", e.params.Host,
"offset", e.offset,
} }
if len(e.params.Host) > 0 {
p.Add("host", e.params.Host)
}
p.Add("offset", e.offset)
return p
} }
func (e EosioV2) Call() (haproxy.HealthCheckStatus, string) { func (e EosioV2) Call() (haproxy.HealthCheckStatus, string) {