我有一个简单的cron作业使用石英插件,它每天早上7点正确触发,但它也在早上8:33再次触发。也许我的cron表达式出了问题?为什么要等93分钟再次射击?
class TaskReminderJob {
def requestPeerEvaluationService
def compositeEvaluationService
def performanceReviewCreationService
static triggers = {
// check everyday at 7am
cron name: 'emailTrigger', cronExpression: "0 0 7 1/1 * ? *"
}
def execute() {
// if any outstanding peer reviews, send email reminder
requestPeerEvaluationService.checkIfPeerNeedsReminding()
// remind supervisor(s) if composite evaluations need approving
compositeEvaluationService.checkForLongStandingApprovals()
// if an employee has not completed a self evaluation, send reminder
performanceReviewCreationService.remindEmployeeOfSelfEvaluation()
}
}
更新:发送的每封电子邮件都会记录到文件中,而第二封电子邮件从未记录过。好像我的代码没有执行两次。