From e6a144bcf9630e4541989b76654adb6900fad316 Mon Sep 17 00:00:00 2001 From: Andrew Davis <1709934+Savid@users.noreply.github.com> Date: Fri, 28 Jul 2023 18:22:30 +1000 Subject: [PATCH] feat(server/coordinator): ignore empty geo data --- pkg/server/service/coordinator/client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/server/service/coordinator/client.go b/pkg/server/service/coordinator/client.go index 12b57a40..f2bdab6e 100644 --- a/pkg/server/service/coordinator/client.go +++ b/pkg/server/service/coordinator/client.go @@ -107,7 +107,8 @@ func (c *Client) CreateNodeRecords(ctx context.Context, req *xatu.CreateNodeReco c.log.WithField("ip", *ipAddress).WithError(err).Warn("failed to lookup geoip data") } - if geoipLookupResult != nil && geoipLookupResult.Longitude != 0 && geoipLookupResult.Latitude != 0 { + if geoipLookupResult != nil && !(geoipLookupResult.Longitude == 0 && geoipLookupResult.Latitude == 0) { + c.log.WithField("ip", *ipAddress).WithField("geoip", geoipLookupResult).Warn("geoip lookup result") pRecord.GeoCity = &geoipLookupResult.CityName pRecord.GeoCountry = &geoipLookupResult.CountryName pRecord.GeoCountryCode = &geoipLookupResult.CountryCode