You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.2 KiB
C#

using Hangfire;
namespace DS.WMS.JobService
{
public class Worker : BackgroundService
{
private readonly ILogger<Worker> _logger;
public Worker(ILogger<Worker> logger)
{
_logger = logger;
//using (new BackgroundJobServer())
//{
// new BackgroundJobServerOptions()
// {
// Queues = new[] { "op", "task" }
// };
//}
}
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
while (!stoppingToken.IsCancellationRequested)
{
//using (new BackgroundJobServer())
//{
// //new BackgroundJobServerOptions()
// //{
// // Queues = new[] { "op", "task" }
// //};
//}
//if (_logger.IsEnabled(LogLevel.Information))
//{
// _logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now);
//}
//await Task.Delay(1000, stoppingToken);
}
}
}
}