优化定时任务,新增简单定时任务

This commit is contained in:
不做码农
2022-03-17 21:24:40 +08:00
parent a47821fb69
commit 74bf025a65
11 changed files with 309 additions and 282 deletions

View File

@@ -1,11 +1,14 @@
using Quartz;
using Infrastructure.Attribute;
using Quartz;
using System.Threading.Tasks;
namespace ZR.Tasks
namespace ZR.Tasks.TaskScheduler
{
/// <summary>
/// 定时任务测试
/// 使用如下注册后TaskExtensions里面不用再注册了
/// </summary>
[AppService(ServiceType = typeof(Job_SyncTest), ServiceLifetime = LifeTime.Scoped)]
public class Job_SyncTest : JobBase, IJob
{
//private readonly NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
@@ -20,6 +23,7 @@ namespace ZR.Tasks
await Task.Delay(1);
//TODO 业务逻辑
System.Console.WriteLine("job test");
}
}
}