Skip to content

Commit

Permalink
feat(server/coordinator): ignore empty geo data
Browse files Browse the repository at this point in the history
  • Loading branch information
Savid committed Jul 28, 2023
1 parent e2d0dc8 commit e6a144b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/server/service/coordinator/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e6a144b

Please sign in to comment.