T1-T4: TaskController+3个IJob改用IServiceProvider构造注入+RuleEngineJob标记废弃
This commit is contained in:
@@ -18,9 +18,12 @@ namespace VolPro.Warehouse.Services;
|
||||
/// </summary>
|
||||
public class RealtimePollJob : IJob
|
||||
{
|
||||
public async Task Execute(IJobExecutionContext context)
|
||||
private readonly IServiceProvider _sp;
|
||||
public RealtimePollJob(IServiceProvider sp) { _sp = sp; }
|
||||
|
||||
public async Task Execute(IJobExecutionContext? context)
|
||||
{
|
||||
var sp = (IServiceProvider)context.JobDetail.JobDataMap["ServiceProvider"];
|
||||
var sp = _sp;
|
||||
if (sp == null) return;
|
||||
|
||||
var gwSvc = sp.GetService<Igateway_nodesService>();
|
||||
|
||||
Reference in New Issue
Block a user