You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
832 B
44 lines
832 B
using Microsoft.Extensions.DependencyInjection;
|
|
using Serilog.Core;
|
|
using System;
|
|
using Tiobon.Core.Common;
|
|
using Tiobon.Core.Tasks;
|
|
|
|
namespace Tiobon.Core.Jobs;
|
|
|
|
/// <summary>
|
|
/// 任务处理中心
|
|
/// </summary>
|
|
public class TaskCenter
|
|
{
|
|
private readonly ISchedulerCenter _schedulerCenter;
|
|
|
|
static TaskCenter()
|
|
{
|
|
//ReloadOnChange = true 当appsettings.json被修改时重新加载
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 初始化
|
|
/// </summary>
|
|
public TaskCenter(ISchedulerCenter schedulerCenter)
|
|
{
|
|
_schedulerCenter = schedulerCenter;
|
|
}
|
|
|
|
#region 启动任务服务
|
|
/// <summary>
|
|
/// 启动任务服务
|
|
/// </summary>
|
|
public void Start()
|
|
{
|
|
var container = new ServiceCollection();
|
|
|
|
_schedulerCenter.InitJobAsync();
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
} |