Merge branch 'dev' of https://git.tuotong-tech.com/tnb/tnb.server into dev
This commit is contained in:
@@ -44,9 +44,10 @@ namespace Tnb.WarehouseMgr
|
||||
static TimedTaskBackgroundService()
|
||||
{
|
||||
_timedFuncMap = App.EffectiveTypes.AsParallel().Where(t => !t.Namespace.IsNullOrWhiteSpace() && t.Namespace.Contains("Tnb.WarehouseMgr")).SelectMany(t => t.GetMethods())
|
||||
.Where(m => m.GetCustomAttribute<TimedAttribute>() != null)
|
||||
.ToDictionary(x => x.Name, x =>
|
||||
(Func<CancellationTokenSource?, Task>)Delegate.CreateDelegate(typeof(Func<CancellationTokenSource?, Task>), App.GetService(x.DeclaringType), x));
|
||||
.Where(m => m.GetCustomAttribute<TimedAttribute>() != null)
|
||||
.ToDictionary(x => x.Name, x =>
|
||||
(Func<CancellationTokenSource?, Task>)Delegate.CreateDelegate(typeof(Func<CancellationTokenSource?, Task>), App.GetService(x.DeclaringType), x));
|
||||
|
||||
}
|
||||
public TimedTaskBackgroundService(IServiceProvider serviceProvider)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user