ClearLogJob.cs
771 Bytes
using System;
using System.Threading.Tasks;
using Hh.Mes.Service.QuartzJobService;
namespace Quartz.Job
{
/// <summary>
/// 命名空间Quartz.Job 保持一致
/// </summary>
[PersistJobDataAfterExecution]
[DisallowConcurrentExecution]
public class ClearLogJob : IJob
{
public Task Execute(IJobExecutionContext context)
{
try
{
new ClearLogJobService().Execute();
}
catch (Exception ex)
{
var jobContainer = new JobContainer(context)
{
ExceptionInfo = ex.Message
};
jobContainer.LoggerJob();
}
return Task.CompletedTask;
}
}
}