quartz.net

Ninject scoping for DBContext used in Quartz.Net job

萝らか妹 提交于 2019-11-30 21:15:31
What's the best scoping to use for a DbContext implementation that gets instantiated via Ninject dependency resolver during execution of a Quartz.Net job implementation? If I used thread scope, will the same instance of DbContext get served if the same thread in Quartz's thread pool is used to execute the job multiple times? I would like a scope that means I get one (and only one) new instance of the DbContext each time the job is fired. BatteryBackupUnit Yes, i would advise against using InThreadScope . When a thread-pool thread is used, there will be leakage. Furthermore, there's nothing

Quartz.NET - Shouldn't this unit test pass?

假装没事ソ 提交于 2019-11-30 15:35:31
This question is related to this one , but is kept more general and can be treated independently. EDIT: Quartz version is v2.0.1 From my understanding, the following unit test should pass: [Test] public void Test() { // run every first day of month at 14:00 hours CronExpression expression = new CronExpression("0 0 14 1 * ?"); // TimeZoneInfo.Local = {(UTC+01:00) Amsterdam, Berlin, Bern, Rom, Stockholm, Wien} if (!TimeZoneInfo.Local.SupportsDaylightSavingTime) { return; } // get "summertime" period for current timezone var daylightChange = TimeZone.CurrentTimeZone.GetDaylightChanges(2013); // -

Can quartz.net reconfigure jobs when config file changes?

烂漫一生 提交于 2019-11-30 14:01:18
问题 Im doing a proof of concept with Quartz.Net A fairly simple scheduling task, the only requirement i have is that a restart of the service it not needed to reconfigure quartz This is test code var factory = new StdSchedulerFactory(); var scheduler = factory.GetScheduler(); scheduler.Start(); Relevant data in app.config <quartz> <add key="quartz.scheduler.instanceName" value="QuartzScheduler" /> <!-- Configure Thread Pool --> <add key="quartz.threadPool.type" value="Quartz.Simpl

Autofac and Quartz.Net Integration

萝らか妹 提交于 2019-11-30 11:26:43
Does anyone have any experience integrating autofac and Quartz.Net ? If so, where is it best to control lifetime management -- the IJobFactory, within the Execute of the IJob, or through event listeners? Right now, I'm using a custom autofac IJobFactory to create the IJob instances, but I don't have an easy way to plug in to a ILifetimeScope in the IJobFactory to ensure any expensive resources that are injected in the IJob are cleaned up. The job factory just creates an instance of a job and returns it. Here are my current ideas (hopefully there are better ones...) It looks like most AutoFac

Quartz.NET trigger does not fire, MVC4

不羁岁月 提交于 2019-11-30 07:36:11
I have a MVC4 .Net web application on 3-tier architecture with Unity dependency injection, and I want to shedule everyday a verficiation and send some mails where is the case. For this I want to use Quartz Scheduler in Application_start, because of the dependency injection windows service is not a good option. Here is my code in application_start. // construct a scheduler factory ISchedulerFactory schedFact = new StdSchedulerFactory(); IScheduler sched = schedFact.GetScheduler(); sched.Start(); IJobDetail dailyUserMailJob = new JobDetailImpl("DailyUserMailJob", null, typeof(SchedulerJob)); //

Refire quartz.net trigger after 15 minutes if job fails with exception

不问归期 提交于 2019-11-30 06:51:47
I have searched for an answer on how to retrigger a job after a ceratin amount of time, if the job throws an exception. I cannot see any simple way of doing this. if I set my trigger up like this: JobDetail job = new JobDetail("Download catalog", null, typeof(MyJob)); job .Durable = true; Trigger trigger= TriggerUtils.MakeDailyTrigger(12, 0); trigger.StartTimeUtc = DateTime.UtcNow; trigger.Name = "trigger name"; scheduler.ScheduleJob(job , trigger); And MyJob look like this: public class MyJob : IJob { public void Execute(JobExecutionContext context) { var service = new service(); try {

Castle.Windsor lifestyle depending on context?

匆匆过客 提交于 2019-11-30 04:35:39
I have a web application where many components are registered using .LifestylePerWebRequest() , now I've decided to implement Quartz.NET , a .NET job scheduling library, which executes in separate threads, and not the Request thread. As such, HttpContext.Current yields null . My services, repositories, and IDbConnection were instanced so far using .LifestylePerWebRequest() because it made it easier to dispose of them when the requests ended. Now I want to use these components in both scenarios, during web requests I want them to remain unaffected, and in non-request contexts I want them to use

Create a Quartz.NET Job with several constructor parameters

十年热恋 提交于 2019-11-30 03:56:58
问题 I have a job which needs to kick off some methods on another object. I'd like to be able to pass these into the job in its constructor. Looking around, it seems that the only way to achieve this is to use one of IoC frameworks. Whilst this method will be a solution for me in the future, right now I need a vanilla solution, not requiring any IoC. I am aware of the JobDataMap but the Best Practices documentation advises against this due to serialization. The object is multi-threaded and

In Quartz.NET is there a way to set a property that will only allow one instance of a Job to run?

别来无恙 提交于 2019-11-29 23:44:09
I have a service that will run every X minutes. If that job takes longer than X minutes for some unforeseen reason I want to make sure that the trigger doesn't kick off a second instance of this job. Sample Scenario I have Job X, picks up files and is triggered by Quartz every 1 minute. Job X can typically process 100 files in 1 minute, anything over 100 files will take longer than 1 minute. Since the last run time, 150 files happen to be out there so Job X kicks off and begins processing. When 1 minute is reached 100 files were processed, 50 files remain, and Job X continues to run. However a

Where is the documentation for Quartz.NET configuration files?

这一生的挚爱 提交于 2019-11-29 21:18:36
I can't find documentation anywhere on the syntax for Quartz.NET configuration files. I'd like to learn about Configuring the service itself Configuring jobs via the XML scheduler plugin. I've seen plenty of examples, but I'm looking for a definitive syntax document that shows me all of my options. I was having a heck of a time finding info on the config format as well. Turns out the Quartz.Net source contains a nice sample App.config file in src/Quartz.Examples . It looks like the snippet below, except that I've omitted the Common.Logging configuration, which is explained in detail (with an