How to cancel a scheduled Quartz job in Spring

后端 未结 2 1863
生来不讨喜
生来不讨喜 2021-02-04 04:54

I\'m using Spring to inject a Quartz scheduler (abstracted with Spring\'s TaskScheduler interface) into my app that loads jobs configured from a database at startup.

It

相关标签:
2条回答
  • 2021-02-04 05:11

    Unscheduling a Particular Trigger of Job

    scheduler.unscheduleJob(triggerName, triggerGroup);
    

    Deleting a Job and Unscheduling All of Its Triggers

    scheduler.deleteJob(jobName, jobGroup);
    

    Ref: http://www.opensymphony.com/quartz/wikidocs/UnscheduleJob.html

    0 讨论(0)
  • 2021-02-04 05:26
    ScheduledFuture<V> job = taskSchedule.schedule(runableThing, new CronTrigger(cronExpression))
    job.cancel(true); 
    
    0 讨论(0)
提交回复
热议问题