Quartz works in Grails app three times

I have the following Quartz Job in a Grails application. The task calculates some statistics, as well as sends and e-mails these data. I want the work to be done every day at 7 o’clock.

My problem is that the task is run three times every day, and not just once.

class DailyEmailJob  {
    def eventService 

    static triggers = {
        cron name: 'emailTrigger', cronExpression: "0 0 7 * * ?"
    }

    def execute() {
        eventService.send24StatsEmail()
    }
}

I host a Grails application on Apache Tomcat / 7.0.35 using Grails 2.2.1 and quartz-1.0-RC6

+5
source share
3 answers

Your cron expression looks ok. A feature of Tomcat's automatic deployment feature may be a culprit. For some tips, see: fooobar.com/questions/896086 / ...

+2

. , . , .

END

, , .

" , 7 ?"

7 , 2 9 ?

:

: -

" '/' . ," 0/15 " " 0, 15, 30 45 ". " 5/15 " " 5, 20, 35 50 ". " * " , " / " 0, - , . , . 0 59. 0 23, 0 31 1 12. " / " " n- " . ," 7/6 " " 7 ", , , ."

cron: "0 0 7 * * ?" 7 24 (), 7 , (7 + 7) 2 , (7 + 7 + 7) 9 .

quartz-scheduler.org . . " /".

seconds minutes [ 24 , :)), , CronExpression execute() 7:00 Hrs :

:

  • "0 0 7/23 * * ?" [ 24 , 7- 0- 0- ]
  • "0 0 0/23,7 * * ?" [ 1, .]

. , . /, 24 ( JVM-, , )., .

+2

,

"?", , . , , "*"; unix crontab.

,

+1

All Articles