grails / grails-quartz

This project provides integration of the Quartz scheduling framework into the Grails Framework
http://grails.org/plugin/quartz
Apache License 2.0
76 stars 90 forks source link

Suggestion: Configure triggers from properties #92

Open rrsdev opened 7 years ago

rrsdev commented 7 years ago

I'm sure this is a more complex task than it sounds, but the basic idea mightbe something like:

(application.yml):

quartz;
  triggers:
    - name: 'cronTrigger1'
      type: cron
      cronExpression: '0 0 2 * * ?'
    - name: 'cronTrigger2'
      type: cron
      cronExpression: '0 0 12 * * 1'
    - name: 'simpleTrigger1'
      type: simple
      startDelay:10000, 
      repeatInterval: 30000, 
      repeatCount: 10

Then perhaps the Job would look like:

class MyJob  {
    static triggers = {
        configured name: 'cronTrigger1'
    }
}