Enhance UI, add AI integration, improve logging and database stats
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user