Добавил дополнительное логирование для отслеживания дублей.
This commit is contained in:
parent
4510f4d025
commit
f65d1fe7b2
@ -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:
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user