using PARR.TemplateUpdater; namespace PARR.TemplateUpdaterWorker { public class Worker : BackgroundService { private readonly ILogger _logger; private readonly ITemplateUpdater templateUpdater; public Worker(ILogger 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); } } }