Files
jinko.yikatong/Src/Dlhis.Middle/Services/Implements/HealthCheckBackgroundService.cs
2024-06-26 12:14:39 +08:00

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();
}
}
}