feat(aihit): AIHITLoadWorker + AIHITSyncWorker

This commit is contained in:
Mikhail Kuznetsov
2024-02-05 14:45:09 +10:00
parent 2ee7ad9dd4
commit 3d71f4cbe9
24 changed files with 826 additions and 19 deletions

View File

@@ -1,21 +1,21 @@
using PARR.AIHITLoader;
namespace PARR.AIHITLoaderWorker
{
public class Worker : BackgroundService
{
private readonly ILogger<Worker> _logger;
private readonly IAihitLoader aihitLoader;
public Worker(ILogger<Worker> logger)
public Worker(ILogger<Worker> logger, IAihitLoader aihitLoader)
{
_logger = logger;
this.aihitLoader = aihitLoader;
}
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
while (!stoppingToken.IsCancellationRequested)
{
_logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now);
await Task.Delay(1000, stoppingToken);
}
await aihitLoader.StartAsync();
}
}
}