添加es服务扩展

This commit is contained in:
橙子
2021-11-09 18:50:49 +08:00
parent 6d5f2cbae7
commit c50bc97c51
15 changed files with 490 additions and 11 deletions

View File

@@ -0,0 +1,29 @@
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace Yi.Framework.ElasticSearchProcessor
{
public class Worker : BackgroundService
{
private readonly ILogger<Worker> _logger;
public Worker(ILogger<Worker> logger)
{
_logger = logger;
}
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
while (!stoppingToken.IsCancellationRequested)
{
_logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now);
await Task.Delay(100000, stoppingToken);
}
}
}
}