Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recommendations for cron-like scheduling in Grails: run method once every hour

Tags:

grails

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?

like image 218
knorv Avatar asked Dec 09 '22 16:12

knorv


1 Answers

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

like image 199
armandino Avatar answered May 26 '23 19:05

armandino