feat(templateUpdater): основная логика + cicd
This commit is contained in:
29
PARR.TemplateUpdaterWorker/Worker.cs
Normal file
29
PARR.TemplateUpdaterWorker/Worker.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using PARR.TemplateUpdater;
|
||||
|
||||
namespace PARR.TemplateUpdaterWorker
|
||||
{
|
||||
public class Worker : BackgroundService
|
||||
{
|
||||
private readonly ILogger<Worker> _logger;
|
||||
private readonly ITemplateUpdater templateUpdater;
|
||||
|
||||
public Worker(ILogger<Worker> logger, ITemplateUpdater templateUpdater)
|
||||
{
|
||||
_logger = logger;
|
||||
this.templateUpdater = templateUpdater;
|
||||
}
|
||||
|
||||
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
||||
{
|
||||
await templateUpdater.StartAsync();
|
||||
await Task.Delay(Timeout.Infinite, stoppingToken);
|
||||
}
|
||||
|
||||
public override async Task StopAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
await templateUpdater.StopAsync();
|
||||
await base.StopAsync(cancellationToken);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user