feat:添加任务调度,系统每天12点、0点重置一次
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Furion.DependencyInjection;
|
||||
|
||||
namespace Yi.Framework.Infrastructure.Data.DataSeeds
|
||||
{
|
||||
|
||||
public class DataSeedExecuteHandler : ISingleton
|
||||
{
|
||||
private IEnumerable<IDataSeed> _dataSeeds;
|
||||
public DataSeedExecuteHandler(IEnumerable<IDataSeed> dataSeeds)
|
||||
{
|
||||
_dataSeeds = dataSeeds;
|
||||
}
|
||||
|
||||
public async Task Invoker()
|
||||
{
|
||||
foreach (var dataSeed in _dataSeeds)
|
||||
{
|
||||
await dataSeed.InvokerAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using Furion;
|
||||
using Furion.Schedule;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
@@ -36,6 +37,8 @@ public class Startup : AppStartup
|
||||
{
|
||||
options.Filters.Add<PermissionGlobalAttribute>();
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
public async void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
|
||||
Reference in New Issue
Block a user