From 51a9625d77946bdfd69eb8e5707e0f7c45ed29a7 Mon Sep 17 00:00:00 2001 From: gsd Date: Wed, 20 May 2026 01:35:30 +0300 Subject: [PATCH] geoip fix --- src/main/java/app/services/db/GraphService.java | 2 +- src/main/java/app/services/io/readers/GeoIPCity.java | 1 + src/main/java/app/services/io/readers/GeoIPCountry.java | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/app/services/db/GraphService.java b/src/main/java/app/services/db/GraphService.java index 1fa0332..10b2ac5 100644 --- a/src/main/java/app/services/db/GraphService.java +++ b/src/main/java/app/services/db/GraphService.java @@ -127,7 +127,7 @@ public class GraphService { } 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); } } diff --git a/src/main/java/app/services/io/readers/GeoIPCity.java b/src/main/java/app/services/io/readers/GeoIPCity.java index 5362cfe..0d3f07a 100644 --- a/src/main/java/app/services/io/readers/GeoIPCity.java +++ b/src/main/java/app/services/io/readers/GeoIPCity.java @@ -28,6 +28,7 @@ public class GeoIPCity extends BaseReader { try { return databaseReader.city(InetAddress.getByName(ip)).getCity().getName(); } catch (Exception e) { + logger.error("[IGNORING] Cannot fetch city of ip", e); return "Unknown"; } } diff --git a/src/main/java/app/services/io/readers/GeoIPCountry.java b/src/main/java/app/services/io/readers/GeoIPCountry.java index 6d7c731..405d2ae 100644 --- a/src/main/java/app/services/io/readers/GeoIPCountry.java +++ b/src/main/java/app/services/io/readers/GeoIPCountry.java @@ -28,6 +28,7 @@ public class GeoIPCountry extends BaseReader { try { return databaseReader.country(InetAddress.getByName(ip)).getCountry().getName(); } catch (Exception e) { + logger.error("[IGNORING] Cannot fetch country of ip"); return "Unknown"; } }