32 lines
826 B
C#
32 lines
826 B
C#
using bdAsegasa.db;
|
|
using Servicio_Gestion_Asegasa.Procesos;
|
|
using System.Reflection;
|
|
|
|
namespace Servicio_Gestion_Asegasa
|
|
{
|
|
public class Worker : BackgroundService
|
|
{
|
|
private readonly ILogger<Worker> _logger;
|
|
|
|
public Worker(ILogger<Worker> logger)
|
|
{
|
|
_logger = logger;
|
|
}
|
|
|
|
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
|
{
|
|
|
|
// await ProcesosMensajes.EnviaSMSAsync();
|
|
|
|
while (!stoppingToken.IsCancellationRequested)
|
|
{
|
|
if (_logger.IsEnabled(LogLevel.Information))
|
|
{
|
|
_logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now);
|
|
}
|
|
await Task.Delay(1000, stoppingToken);
|
|
}
|
|
}
|
|
}
|
|
}
|