internal void Start(IHost host) { var topshelfEnabled = false; bool.TryParse(_configuration["BackgroundServer:TopshelfEnabled"], out topshelfEnabled); var connectionString = _configuration["BackgroundServer:HangfireConnectionString"]; if (topshelfEnabled) { _topshelfStarter.Start(host, connectionString); } else { _backgroundServerManager.Start(host.Services, connectionString); var job = new HelloWorldRecurringJob(); _recurringJobScheduler.Register(job); Console.ReadLine(); } }
internal void Initialize() { _recurringJobs.ForEach(job => _recurringJobScheduler.Register(job)); }