Last change
on this file since f554983 was f554983, checked in by Dimitar Slezenkovski <dslezenkovski@…>, 4 years ago |
Add cron job for updating data, with Quartz.NET
|
-
Property mode
set to
100644
|
File size:
704 bytes
|
Line | |
---|
1 | using Microsoft.Extensions.DependencyInjection;
|
---|
2 | using Quartz;
|
---|
3 | using Quartz.Spi;
|
---|
4 | using System;
|
---|
5 | using System.Collections.Generic;
|
---|
6 | using System.Text;
|
---|
7 |
|
---|
8 | namespace FarmatikoServices.Services
|
---|
9 | {
|
---|
10 | public class SingletonUpdateDataJobFactory : IJobFactory
|
---|
11 | {
|
---|
12 | private readonly IServiceProvider _serviceProvider;
|
---|
13 | public SingletonUpdateDataJobFactory(IServiceProvider serviceProvider)
|
---|
14 | {
|
---|
15 | _serviceProvider = serviceProvider;
|
---|
16 | }
|
---|
17 |
|
---|
18 | public IJob NewJob(TriggerFiredBundle bundle, IScheduler scheduler)
|
---|
19 | {
|
---|
20 | return _serviceProvider.GetRequiredService(bundle.JobDetail.JobType) as IJob;
|
---|
21 | }
|
---|
22 |
|
---|
23 | public void ReturnJob(IJob job) { }
|
---|
24 | }
|
---|
25 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.