Enhance UI, add AI integration, improve logging and database stats

This commit is contained in:
Richard
2026-07-04 21:11:31 +02:00
parent 7a44914d9d
commit d102af2965
57 changed files with 4025 additions and 229 deletions
@@ -36,7 +36,7 @@ public class PollingWorker : BackgroundService
using (var scope = _services.CreateScope())
{
var repo = scope.ServiceProvider.GetRequiredService<ITraderRepository>();
tradersToProcess = await repo.GetAllAsync(take: 100, ct: stoppingToken);
tradersToProcess = await repo.GetTradersForPollingAsync(take: 100, ct: stoppingToken);
}
_logger.LogWarning("📊 Polling {Count} traders...", tradersToProcess.Count);
@@ -121,7 +121,7 @@ public class PollingWorker : BackgroundService
{
// Final deduplication of the batch itself
var uniqueNewTrades = newTrades
.GroupBy(tr => tr.PlatformTradeId)
.GroupBy(tr => tr.PlatformTradeId, StringComparer.OrdinalIgnoreCase)
.Select(g => g.First())
.ToList();
@@ -135,7 +135,7 @@ public class PollingWorker : BackgroundService
}
catch (Exception ex) when (ex.ToString().Contains("Duplicate entry") || (ex.InnerException?.Message.Contains("Duplicate entry") ?? false))
{
_logger.LogWarning("{Trader}: Skipping batch due to duplicate entries (likely already imported)", trader.DisplayName);
_statsService.TrackDuplicateError(trader.Platform, 1);
}
}
else