0
luizluan created
I need to start the quartz when I start the web site, I have two jobs one of them runs once a day and the other one every 6 hours.
The method that calls the Job is in an IDomainService, even if I take it from there I still need to resolve the dependencies.
public class QuartzDomainManager : IQuartzDomainManager
{
private readonly IQuartzScheduleJobManager _jobManager;
private readonly IAbpQuartzConfiguration _quartzConfiguration;
public QuartzDomainManager(IQuartzScheduleJobManager jobManager, IAbpQuartzConfiguration quartzConfiguration)
{
_jobManager = jobManager;
_quartzConfiguration = quartzConfiguration;
}
}
3 Answer(s)
-
0
You can start it in PostInitialize method of your module.
-
0
Thanks :D
-
0
Works very well
public override async void Initialize() { IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly()); AreaRegistration.RegisterAllAreas(); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); await Configuration.IocManager.Resolve<IQuartzDomainManager>().ScheduleGeneral(); }