Ejemplo n.º 1
0
        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();
            }
        }
Ejemplo n.º 2
0
 internal void Initialize()
 {
     _recurringJobs.ForEach(job => _recurringJobScheduler.Register(job));
 }