Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

programmatically scheduling a recurring task silently fails #24

Open
edwardotis opened this issue May 22, 2017 · 1 comment
Open

programmatically scheduling a recurring task silently fails #24

edwardotis opened this issue May 22, 2017 · 1 comment

Comments

@edwardotis
Copy link

The static trigger inside a class with a quartz cron expression works.
However, this has the down side that every time a server reboots, it restarts the cronjob.
This is not acceptable behavior in many applications.
We need to be able to programmatically start and stop recurring tasks at runtime.

Removing a recurring task works programatically. (Though it does throw multiple exceptions.)
jesqueSchedulerService.deleteSchedule("MyDemoJesqueJobTrigger")

However, the jesqueSchedulerService#schedule functionality silently fails to add the same recurring job that works from static triggers.
jesqueSchedulerService.schedule("MyDemoJesqueJobTrigger, "0/5 * * * * ?", Constants.JESQUE_CRONJOB_QUEUE_NAME, TestRecurringJob.simpleName, [])

This scheduling behavior works correct in jesque.
https://github.com/gresrun/jesque#recurring-jobs

Jesque lacks the quartz cron expressions support that grails jesque has. The quartz cron expression is much better for many use cases than setting the milliseconds between job executions.

v1.2.1 plugin
3.1.16 grails

@edwardotis edwardotis changed the title scheduling a recurring task programmatically silently fails programmatically scheduling a recurring task silently fails May 22, 2017
@bp-FLN
Copy link
Contributor

bp-FLN commented Jan 19, 2019

not sure if adding support for recurring jobs is the right thing to do, as a trigger provides the same behaviour

However, this has the down side that every time a server reboots, it restarts the cronjob.

what exactly do you mean with "restarts the cronjob"? what issue does it cause for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants