19 lines
546 B
C#
19 lines
546 B
C#
namespace Dlhis.Middle.Services.Implements;
|
|
|
|
public class HealthCheckBackgroundService : BackgroundService
|
|
{
|
|
private readonly IHealthCheckService _healthCheckService;
|
|
|
|
public HealthCheckBackgroundService(IHealthCheckService healthCheckService)
|
|
{
|
|
_healthCheckService = healthCheckService;
|
|
}
|
|
|
|
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
|
{
|
|
while (!stoppingToken.IsCancellationRequested)
|
|
{
|
|
await _healthCheckService.DoHealthCheckAsync();
|
|
}
|
|
}
|
|
} |