Simran Kaur
Simran Kaur

Reputation: 31

Grails Scheduled Quartz Job never runs

Here is the Code:

class FollowUpJobOne {

        FollowUpMailService followUpMailService;
        static triggers = {
            cron name: 'jobOneForFollowUp', cronExpression: "00 00 6 ? * *" //6 AM everyday as per server time

        }
        def execute() {
            log.debug("control in Follow up job");
            followUpMailService.sendFollowUpMails();
            followUpMailService.sendFollowUpMailsForDandO();
        }
    }

*This Above Job never runs at 6 a.m. I am unable to find the issue. Please Help

Upvotes: 0

Views: 506

Answers (2)

CHAAAA
CHAAAA

Reputation: 46

  1. use grails create-job to create a job class which should be end with Job
  2. cronExpression use 0 0 6 * * ?. Not sure whether quartz can parse 00.
  3. confirm autoStartup = true

Upvotes: 0

Evgeny Smirnov
Evgeny Smirnov

Reputation: 3016

Your class should ends with Job. Just rename FollowUpJobOne to FollowUpOneJob

Upvotes: 2

Related Questions