I have a simple application in GRAILS that uses the Quartz2 plugin. In the job file, I have:
static triggers = { simple repeatCount: 0 // execute job once in 5 seconds cron cronExpression: '0 15 2 * * ?' } def execute() { if (Environment.current == Environment.PRODUCTION) do something... }
In this case, everything works fine, if it does not work, the trigger is ignored. Now the question is simple, if I run the application during the production process, tasks begin as soon as the rake begins. I want to avoid the work done as soon as possible when the application starts, but only when it is correctly installed in cronExpression.
Any idea?
UPDATE: At the end, I put this line in config.groovy:
environments { development { grails.logging.jul.usebridge = true grails.plugin.quartz2.autoStartup = false } production { grails.logging.jul.usebridge = false } }
Now it doesn't seem to start with bootstrap, I need to do a couple more tests, and I'll let you know.
Thank you
UPDATE2: Well, now the schedule does not start at all, I expected it to start, but did not complete the scheduled tasks, but wait for the right time to start it. Any help?
Thank you very much
Update3: Sorry, but I feel very stupid, adding a simple repeatCount: 0 fire once at startup, so I delete that it works fine, sorry again.
Nibe source share