bag
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Quartz;
|
||||
using Quartz.Impl;
|
||||
|
||||
namespace YhCore.Tasks
|
||||
{
|
||||
/// <summary>
|
||||
/// 任务调度注册扩展:Quartz 调度器工厂 + 宿主服务(对应 Java scheduler 自动装配)。
|
||||
/// </summary>
|
||||
public static class QuartzServiceCollectionExtensions
|
||||
{
|
||||
public static IServiceCollection AddQuartzHosted(this IServiceCollection services)
|
||||
{
|
||||
services.AddSingleton<ISchedulerFactory, StdSchedulerFactory>();
|
||||
services.AddHostedService<QuartzHostedService>();
|
||||
return services;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user