Добавил дополнительное логирование для отслеживания дублей.

This commit is contained in:
ruberoid 2025-10-16 13:37:17 +04:00
parent 4510f4d025
commit f65d1fe7b2
2 changed files with 7 additions and 0 deletions

View File

@ -45,6 +45,9 @@ public sealed class UpdateHandler(
private async Task HandleMessage(MessageBase messageBase, bool edit = false)
{
_logger.LogDebug("HandleMessage called for {MessageType} with ID {MessageId}, edit={Edit}",
messageBase.GetType().Name, messageBase.ID, edit);
switch (messageBase)
{
case Message m:

View File

@ -71,8 +71,12 @@ public sealed class UpdateListenerBackgroundService : BackgroundService
{
using var scope = _serviceProvider.CreateScope();
var updateHandler = scope.ServiceProvider.GetRequiredService<IUpdateHandler>();
_logger.LogDebug("Received {UpdateType} with {Count} updates", updates.GetType().Name, updates.UpdateList.Length);
foreach (var update in updates.UpdateList)
{
_logger.LogDebug("Processing update {UpdateType} (ID: {UpdateId})", update.GetType().Name, update.GetType().GetProperty("ID")?.GetValue(update) ?? "N/A");
await updateHandler.HandleUpdate(update);
}
}