Changeset 472dd7e
- Timestamp:
- 02/14/21 23:34:17 (4 years ago)
- Branches:
- master
- Parents:
- f554983
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Farmatiko/Startup.cs
rf554983 r472dd7e 122 122 });*/ 123 123 124 services.AddScoped<UpdateDataJob>(); 124 125 services.AddSingleton<IJobFactory, SingletonUpdateDataJobFactory>(); 125 126 services.AddSingleton<ISchedulerFactory, StdSchedulerFactory>(); 126 127 127 services.AddTransient<UpdateDataJob>();128 128 services.AddSingleton(new JobSchedule( 129 129 jobType: typeof(UpdateDataJob), -
FarmatikoServices/Services/SingletonUpdateDataJobFactory.cs
rf554983 r472dd7e 18 18 public IJob NewJob(TriggerFiredBundle bundle, IScheduler scheduler) 19 19 { 20 return _serviceProvider.GetRequiredService(bundle.JobDetail.JobType) as IJob; 20 using (var scope = _serviceProvider.CreateScope()) 21 { 22 return scope.ServiceProvider.GetRequiredService(bundle.JobDetail.JobType) as IJob; 23 } 24 21 25 } 22 26
Note:
See TracChangeset
for help on using the changeset viewer.