server-master/srcs/LogsServer/Consumers/ServiceFlushAllMessageConsumer.cs
2026-02-10 18:21:30 +01:00

20 lines
No EOL
736 B
C#

using System.Threading;
using System.Threading.Tasks;
using PhoenixLib.ServiceBus;
using Plugin.MongoLogs.Services;
using WingsAPI.Communication.Services.Messages;
namespace LogsServer.Consumers
{
public class ServiceFlushAllMessageConsumer : IMessageConsumer<ServiceFlushAllMessage>
{
private readonly MongoLogsBackgroundService _mongoLogsBackgroundService;
public ServiceFlushAllMessageConsumer(MongoLogsBackgroundService mongoLogsBackgroundService) => _mongoLogsBackgroundService = mongoLogsBackgroundService;
public async Task HandleAsync(ServiceFlushAllMessage notification, CancellationToken token)
{
await _mongoLogsBackgroundService.ProcessMain(token);
}
}
}