server-master/srcs/Master/Services/Maintenance/StatusRefreshMessageConsumer.cs
2026-02-10 18:21:30 +01:00

26 lines
No EOL
821 B
C#

// WingsEmu
//
// Developed by NosWings Team
using System.Threading;
using System.Threading.Tasks;
using PhoenixLib.ServiceBus;
using WingsEmu.Health;
namespace Master.Services.Maintenance
{
public class StatusRefreshMessageConsumer : IMessageConsumer<ServiceStatusUpdateMessage>
{
private readonly IStatusManager _statusManager;
public StatusRefreshMessageConsumer(IStatusManager statusManager) => _statusManager = statusManager;
public async Task HandleAsync(ServiceStatusUpdateMessage notification, CancellationToken token) =>
_statusManager.UpdateStatus(new ServiceStatus
{
Status = notification.StatusType,
LastUpdate = notification.LastUpdate,
ServiceName = notification.ServiceName
});
}
}