namespace FabApprovalWorkerService.Workers;

public class UserCertificationUpdateWorker : BackgroundService {
    private readonly ILogger<UserCertificationUpdateWorker> _logger;

    public UserCertificationUpdateWorker(ILogger<UserCertificationUpdateWorker> logger) {
        _logger = logger;
    }

    protected override async Task ExecuteAsync(CancellationToken stoppingToken) {
        while (!stoppingToken.IsCancellationRequested) {
            if (_logger.IsEnabled(LogLevel.Information)) {
                _logger.LogInformation("UserCertificationUpdateWorker running at: {time}", DateTimeOffset.Now);
            }
            await Task.Delay(1000, stoppingToken);
        }
    }
}
