grails cronExpression


I need you to help me with the following.

I have a Job class, with the following definition

static triggers = {             cron name: 'CoreDeleteEventsJob', cronExpression: "0 0/4 * 1/1 *? *", startDelay: 180000

The value of cronExpression can be changed per screen, but when grails are restarted that value is lost and returns to "0 0/4 * 1/1 *? *"

How can I save that value?

I did a test by loading the value saved in the database, defining it in BootStrap.groovy CoreDeleteEventsJob.schedule (CronJobs.findByPropertyKey ("CoreDeleteEventsJob"). Value) But I can not assign a name to CoreDeleteEventsJob, I can only give it a schedule ... So when I do a cron change on the screen and I want to save it in BD, I do not have a trigger name, so to speak ...

Is there a solution?

asked by wagego 27.11.2018 в 19:21

0 answers