From b142329d0929b7e50cf45b89cf4bb9451558fdb1 Mon Sep 17 00:00:00 2001 From: CakeAndBanana Date: Mon, 20 Oct 2025 04:05:27 +0200 Subject: [PATCH] Added some logging for country --- .../LightlessSyncAuthService/Services/GeoIPService.cs | 4 ++++ .../LightlessSyncServer/Hubs/LightlessHub.cs | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/LightlessSyncServer/LightlessSyncAuthService/Services/GeoIPService.cs b/LightlessSyncServer/LightlessSyncAuthService/Services/GeoIPService.cs index 84ea008..1ae5ef9 100644 --- a/LightlessSyncServer/LightlessSyncAuthService/Services/GeoIPService.cs +++ b/LightlessSyncServer/LightlessSyncAuthService/Services/GeoIPService.cs @@ -166,6 +166,10 @@ public class GeoIPService : IHostedService if (_dbReader!.TryCity(ip, out var response)) { + _logger.LogInformation(ip.ToString()); + _logger.LogInformation(response?.Country?.ToString()); + _logger.LogInformation(response?.Country?.IsoCode); + var country = response?.Country?.IsoCode; return !string.IsNullOrEmpty(country) ? country : "*"; } diff --git a/LightlessSyncServer/LightlessSyncServer/Hubs/LightlessHub.cs b/LightlessSyncServer/LightlessSyncServer/Hubs/LightlessHub.cs index 5ec7c3e..01a09c3 100644 --- a/LightlessSyncServer/LightlessSyncServer/Hubs/LightlessHub.cs +++ b/LightlessSyncServer/LightlessSyncServer/Hubs/LightlessHub.cs @@ -190,8 +190,13 @@ public partial class LightlessHub : Hub, ILightlessHub if (_userConnections.TryGetValue(UserUID, out var connectionId) && string.Equals(connectionId, Context.ConnectionId, StringComparison.Ordinal)) { - _lightlessMetrics.DecGaugeWithLabels(MetricsAPI.GaugeConnections, labels: Continent); - _lightlessMetrics.DecGaugeWithLabels(MetricsAPI.GaugeConnections, labels: Country); + var ResultLabels = new List + { + Continent, + Country, + }; + _lightlessMetrics.DecGaugeWithLabels(MetricsAPI.GaugeConnections, labels: [.. ResultLabels]); + try { await GposeLobbyLeave().ConfigureAwait(false);