Jobs Firing Multiple Times
See original GitHub issueVersion: 2.6.0
Expected behavior
Jobs scheduled in global.asax should fire one time each at the time specified in their triggers
Actual behavior
Jobs fire multiple times, seemingly increasing each time I add a new job to my application.
Steps to reproduce
Application_Start()
{
...
var properties = new NameValueCollection { { "quartz.threadPool.threadCount", "1" } };
ISchedulerFactory schedFact = new StdSchedulerFactory(properties);
IScheduler sched = (IScheduler)schedFact.GetScheduler();
sched.Clear();
sched.Start();
IJobDetail dailyEmailJob = JobBuilder.Create<DailyEmails>().WithIdentity("DailyEmailJob").Build();
ITrigger dailyEmailTrigger = TriggerBuilder.Create().WithIdentity("DailyEmailTrigger").WithSchedule(CronScheduleBuilder.DailyAtHourAndMinute(12, 05)).ForJob(dailyEmailJob).Build();
IJobDetail scheduledMaintenanceJob = JobBuilder.Create<ScheduledMaintenance>().WithIdentity("ScheduledMaintenanceJob").Build();
ITrigger scheduledMaintenanceTrigger = TriggerBuilder.Create().WithIdentity("ScheduledMaintenanceTrigger").WithSchedule(CronScheduleBuilder.DailyAtHourAndMinute(1, 0)).ForJob(scheduledMaintenanceJob).Build();
IJobDetail resourceAnalysisJob = JobBuilder.Create<ResourceAnalysis>().WithIdentity("ResourceAnalysisJob").Build();
ITrigger resourceAnalysisTrigger = TriggerBuilder.Create().WithSchedule(SimpleScheduleBuilder.RepeatSecondlyForever(10)).Build();
sched.ScheduleJob(dailyEmailJob, dailyEmailTrigger);
sched.ScheduleJob(scheduledMaintenanceJob, scheduledMaintenanceTrigger);
sched.ScheduleJob(resourceAnalysisJob, resourceAnalysisTrigger);
}
My Job:
[DisallowConcurrentExecution]
public class DailyEmails : IJob
{
public void Execute(IJobExecutionContext jobContext)
{
ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
Log.Info("Call to Daily Email Execute. \r\n");
string url = Helpers.Utilities.GetDomain() + "/Scheduler/DailyEmail/?hash=" + VRS_Scheduler.ScheduledHash;
var client = new WebClient();
var text = client.DownloadString(url);
}
}
My log file looks like so:
2018-05-15 11:55:00,001 INFO [QuartzScheduler_Worker-1] Transport.Web.UI.Infrastructure.Scheduled.DailyEmails - Call to Daily Email Execute.
2018-05-15 11:55:00,002 INFO [QuartzScheduler_Worker-1] Transport.Web.UI.Infrastructure.Scheduled.DailyEmails - Call to Daily Email Execute.
2018-05-15 11:55:00,088 INFO [QuartzScheduler_Worker-1] Transport.Web.UI.Infrastructure.Scheduled.DailyEmails - Call to Daily Email Execute.
As you can see, the Daily Email job runs 3 times…
Issue Analytics
- State:
- Created 5 years ago
- Comments:14 (5 by maintainers)
Top Results From Across the Web
What can you do if you've been fired multiple times? How ...
Up until the early 2000s, staying in the same job for decades used to be the norm. Job hopping was seen as a...
Read more >4 Lessons I Learnt from Getting Fired 4 Times
“Could you come into my office,” your boss asks without a look. You heart pounds in your ears. Your mind races through everything...
Read more >Tips for How To Recover After Losing Your Job
If you've lost your a job, there are several steps you can take to recover, get back in the job market and begin...
Read more >Termination & Retaliation
While Washington is an at-will employment state, employers cannot fire or retaliate against an employee who exercises a protected right or files a...
Read more >update: how much of a red flag is it if a job candidate was ...
Remember the letter-writer asked about a job candidate who had been fired twice previously? Here's the update. I wrote in about six months ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Had a similar issue. A job has been starting 50 times in a row. The reason was an incorrect cron string -
* 0/5 * * * ? *
. Fixed with0 0/5 * * * ?
. Quartz v3.6.2Closing as hard to reproduce. Advice is to run latest Quartz from 3.x series. I suspect this is a configuration problem.