Update AbpBackgroundWorkersQuartzModule.cs

pull/4036/head
liangshiwei 5 years ago
parent 62660a95fc
commit e58c13dcfd

@ -30,9 +30,8 @@ namespace Volo.Abp.BackgroundWorkers.Quartz
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var options = context.ServiceProvider.GetService<IOptions<AbpBackgroundWorkerOptions>>().Value;
var quartzBackgroundWorkerOptions = context.ServiceProvider.GetService<IOptions<AbpBackgroundWorkerQuartzOptions>>().Value;
if (options.IsEnabled && quartzBackgroundWorkerOptions.IsAutoRegisterEnabled)
if (quartzBackgroundWorkerOptions.IsAutoRegisterEnabled)
{
var backgroundWorkerManager = context.ServiceProvider.GetService<IBackgroundWorkerManager>();
var works = context.ServiceProvider.GetServices<IQuartzBackgroundWorker>().Where(x=>x.AutoRegister);

Loading…
Cancel
Save