first commit
This commit is contained in:
27
ZR.Tasks/TaskScheduler/Job_SyncTest.cs
Normal file
27
ZR.Tasks/TaskScheduler/Job_SyncTest.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user