2021-08-23 16:57:25 +08:00

28 lines
667 B
C#

using Quartz;
using System.Threading.Tasks;
namespace ZR.Tasks
{
/// <summary>
/// 定时任务测试
/// </summary>
//[AppService(ServiceLifetime = LifeTime.Scoped)]
public class Job_SyncTest : JobBase, IJob
{
//private readonly NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
public async Task Execute(IJobExecutionContext context)
{
await ExecuteJob(context, async () => await Run());
}
public async Task Run()
{
await Task.Delay(1);
//TODO 业务逻辑
//throw new System.Exception("error");
}
}
}