SystemJob.cs 806 Bytes
using System;
using System.Threading.Tasks;
using Hh.Mes.Service.QuartzJobService;

namespace Quartz.Job
{
    /// <summary>
    /// 命名空间Quartz.Job 保持一致
    /// </summary>
    [PersistJobDataAfterExecution]
    [DisallowConcurrentExecution]
    public class SystemJob : IJob
    {
        public virtual Task Execute(IJobExecutionContext context)
        {
            JobContainer jobContainer = null;
            try
			{
				jobContainer = new JobContainer(context);
				new SystemJobService().Execute(null, null);
            }
            catch (Exception ex)
            {
                jobContainer.ExceptionInfo = ex.Message;
                jobContainer.LoggerJob();
            }
            jobContainer.UpdateJob();
            return Task.CompletedTask;
        }
    }
}