feat:添加任务调度,系统每天12点、0点重置一次

This commit is contained in:
橙子
2023-04-21 23:44:14 +08:00
parent c943c1fc74
commit 51575b9f2d
5 changed files with 82 additions and 0 deletions

View File

@@ -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();
}
}
}
}