Grails canceled quartz work

I have a requirement to plan and calculate the work of quartz programmatically. I was able to schedule it using MyJob.schedule(cronExpression) . Is there a way to similarly disable the work?

I am using a plugin with quartz 0.4.2 with Grails 1.2.3

+4
source share
3 answers

removeJob() completely removes the task and cannot be scheduled again programmatically using MyJob.schedule(Trigger)

This is what worked for me

 quartzScheduler.unscheduleJob("TriggerName", "TriggerGroup") //TriggerName and TriggerGroup are the name and group of the Trigger used for schedule 
+6
source

QuartzGrailsPlugin.groovy says it removeJob() .

+1
source

Launch version 1.0.1

See http://jira.grails.org/browse/GPQUARTZ-132#comment-78800

The default trigger name in MyJob.schedule () is the creepy hard UUID code "GRAILS_586eb149-83f7-486c-88fc-e44a5bb0541" and the static group value "GRAILS_TRIGGERS"

In any A: find your triggerName using cronvalue (assuming it's unique) B: don't use the simple MyJob.schedule (trigger) simplicity provided by the Grails plugin.

0
source

Source: https://habr.com/ru/post/1333115/


All Articles