This commit is contained in:
FanLian
2023-08-15 16:30:56 +08:00

View File

@@ -47,6 +47,7 @@ namespace Tnb.WarehouseMgr
.Where(m => m.GetCustomAttribute<TimedAttribute>() != null) .Where(m => m.GetCustomAttribute<TimedAttribute>() != null)
.ToDictionary(x => x.Name, x => .ToDictionary(x => x.Name, x =>
(Func<CancellationTokenSource?, Task>)Delegate.CreateDelegate(typeof(Func<CancellationTokenSource?, Task>), App.GetService(x.DeclaringType), x)); (Func<CancellationTokenSource?, Task>)Delegate.CreateDelegate(typeof(Func<CancellationTokenSource?, Task>), App.GetService(x.DeclaringType), x));
} }
public TimedTaskBackgroundService(IServiceProvider serviceProvider) public TimedTaskBackgroundService(IServiceProvider serviceProvider)
{ {