ApiInterfaceLogJob.cs 918 Bytes
using System;
using System.Threading.Tasks;
using Quartz;
using WebRepository;
using Task = System.Threading.Tasks.Task;

namespace WebMvc
{
    [PersistJobDataAfterExecution]
    [DisallowConcurrentExecution]
    public class ApiInterfaceLogJob : IJob
    {
        public virtual Task Execute(IJobExecutionContext context)
        {
            JobContainer jobContainer = new JobContainer(context);
            try
            {
                #region 执行任务语句
                ApiInterfaceLogAction ApiinterfaceLogAction = new ApiInterfaceLogAction(jobContainer.ConnString, context);
                ApiinterfaceLogAction.Execute(jobContainer);
                #endregion
            }
            catch (Exception ex)
            {
                jobContainer.ExceptionInfo = ex.Message;
            }

            jobContainer.LoggerJob();

            return Task.CompletedTask;
        }
    }
}