Is it possible to run a cron job on demand in serv...
# questions
t
Is it possible to run a cron job on demand in services? The job will be called once after an hour, for example.
j
Quartz supports kicking off arbitrarily so yeah
g
With the Grails Quartz Plugin, schedule the job once an hour: package myapp.jobs import grails.plugins.quartz.Job class MyJob implements Job { static triggers = { cron name: 'hourlyTrigger', cronExpression: '0 0 * * * ?' } def execute(context) { println "Eseguito alle ${new Date()}" } } Then trigger it just once in your app: MyJob.triggerNow()
j