Beispiel #1
0
        /// <summary>
        /// Starts this instance, delegates to scheduler.
        /// </summary>
        public virtual async void Start()
        {
            try
            {
                scheduler.ListenerManager.AddJobListener(new SchedulerJobListener(), GroupMatcher <JobKey> .AnyGroup());
                await scheduler.Start();

                var quartzManager = new QuartzManager();
                await quartzManager.JobScheduler(scheduler);

                _logger.Info(string.Format("{0} Start", ServiceName));
            }
            catch (Exception ex)
            {
                _logger.Fatal($"Scheduler start failed: {ex.Message}", ex);
                throw;
            }

            _logger.Info("Scheduler started successfully");
        }
Beispiel #2
0
        public void Execute(IJobExecutionContext context)
        {
            string  curRunId = Guid.NewGuid().ToString();
            Version Ver      = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;

            _logger.InfoFormat("ManagerJob[{0}] Execute begin Ver.", Ver.ToString(), curRunId);
            try
            {
                QuartzManager.JobScheduler(context.Scheduler);
                _logger.InfoFormat("ManagerJob[{0}] Executing ...", curRunId);
            }
            catch (Exception ex)
            {
                JobExecutionException e2 = new JobExecutionException(ex);
                e2.RefireImmediately = true;
            }
            finally
            {
                _logger.InfoFormat("ManagerJob[{0}] Execute end ", curRunId);
            }
        }
Beispiel #3
0
        public async Task Execute(IJobExecutionContext context)
        {
            Version Ver = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;

            _logger.InfoFormat("ManagerJob Execute begin Ver." + Ver.ToString());
            try
            {
                var quartzManager = new QuartzManager();
                await quartzManager.JobScheduler(context.Scheduler);

                _logger.InfoFormat("ManagerJob Executing ...");
            }
            catch (Exception ex)
            {
                JobExecutionException e2 = new JobExecutionException(ex);
                e2.RefireImmediately = true;
            }
            finally
            {
                _logger.InfoFormat("ManagerJob Execute end ");
            }
        }