Suppose I want to run the following method foo()
once every hour in Grails:
class FooController {
public static void foo() {
// stuff that needs to be done once every hour (at *:00)
}
}
What is the easiest/recommended way to set up such cron-like scheduling in Grails?
Quartz plugin: http://grails.org/plugin/quartz
Adds Quartz job scheduling features...
Starting from 1.0-RC3, this plugin uses Quartz 2.1.x, and no longer uses Quartz 1.8.x. If you want to use Terracotta 3.6+, this is the plugin to use. This is because the other 'quartz2' plugin doesn't use JobDetailsImpl class, which Terracotta 3.6 requires. See https://jira.terracotta.org/jira/browse/QTZ-310 for more info...
Full documentation can be found here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With