mirror of https://github.com/ErsatzTV/ErsatzTV.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
741 B
19 lines
741 B
using ErsatzTV.Core.Health; |
|
|
|
namespace ErsatzTV.Application.Health; |
|
|
|
public class GetAllHealthCheckResultsHandler : IRequestHandler<GetAllHealthCheckResults, List<HealthCheckResult>> |
|
{ |
|
private readonly IHealthCheckService _healthCheckService; |
|
|
|
public GetAllHealthCheckResultsHandler(IHealthCheckService healthCheckService) => |
|
_healthCheckService = healthCheckService; |
|
|
|
public async Task<List<HealthCheckResult>> Handle( |
|
GetAllHealthCheckResults request, |
|
CancellationToken cancellationToken) |
|
{ |
|
List<HealthCheckResult> results = await _healthCheckService.PerformHealthChecks(cancellationToken); |
|
return results.Filter(r => r.Status != HealthCheckStatus.NotApplicable).ToList(); |
|
} |
|
} |