Browse Source

geoip fix

master
gsd 3 weeks ago
parent
commit
51a9625d77
  1. 2
      src/main/java/app/services/db/GraphService.java
  2. 1
      src/main/java/app/services/io/readers/GeoIPCity.java
  3. 1
      src/main/java/app/services/io/readers/GeoIPCountry.java

2
src/main/java/app/services/db/GraphService.java

@ -127,7 +127,7 @@ public class GraphService {
} }
public void fillCountryAndCity(GeoIPCountry geoIPCountry, GeoIPCity geoIPCity) { public void fillCountryAndCity(GeoIPCountry geoIPCountry, GeoIPCity geoIPCity) {
this.countryAndCity = geoIPCountry.GetCountry(connect_ip) + "/" + geoIPCity.GetCity(countryAndCity); this.countryAndCity = geoIPCountry.GetCountry(connect_ip) + "/" + geoIPCity.GetCity(connect_ip);
} }
} }

1
src/main/java/app/services/io/readers/GeoIPCity.java

@ -28,6 +28,7 @@ public class GeoIPCity extends BaseReader {
try { try {
return databaseReader.city(InetAddress.getByName(ip)).getCity().getName(); return databaseReader.city(InetAddress.getByName(ip)).getCity().getName();
} catch (Exception e) { } catch (Exception e) {
logger.error("[IGNORING] Cannot fetch city of ip", e);
return "Unknown"; return "Unknown";
} }
} }

1
src/main/java/app/services/io/readers/GeoIPCountry.java

@ -28,6 +28,7 @@ public class GeoIPCountry extends BaseReader {
try { try {
return databaseReader.country(InetAddress.getByName(ip)).getCountry().getName(); return databaseReader.country(InetAddress.getByName(ip)).getCountry().getName();
} catch (Exception e) { } catch (Exception e) {
logger.error("[IGNORING] Cannot fetch country of ip");
return "Unknown"; return "Unknown";
} }
} }

Loading…
Cancel
Save