Quartz.NET
- public class RetriggerJob : IInterruptableJob
- {
- private bool _interrupted;
- public void Execute(IJobExecutionContext context)
- {
- Thread.Sleep(1000);
- if (_interrupted)
- {
- return;
- }
- context.Scheduler.TriggerJob(context.JobDetail.Key);
- if (_interrupted)
- {
- context.Scheduler.Interrupt(context.JobDetail.Key);
- }
- }
- public void Interrupt()
- {
- _interrupted = true;
- }
- }
No comments:
Post a Comment