using PARR.JobAutoControl;

namespace PARR.JobAutoControlWorker
{
    public class Worker : BackgroundService
    {
        private readonly IJobAutoControlManager jobAutoControlManager;

        public Worker(IJobAutoControlManager jobAutoControlManager)
        {
            this.jobAutoControlManager = jobAutoControlManager;
        }

        protected override async Task ExecuteAsync(CancellationToken stoppingToken)
        {
            await jobAutoControlManager.StartAsync();
            await Task.Delay(Timeout.Infinite, stoppingToken);
        }
    }
}
