每隔一小时无法在服务器中运行Scheduler

时间:2019-05-27 15:17:30

标签: java

我有两个正在服务器中运行的节点。我的要求是,我需要运行一种方法3次,一次是在6:00 pm,7:00 pm和8:00 pm。

@Transactional("userTransactionManager")
public void userTxnConsolidatedMail() {
}

@Scheduled(cron = "0 00 18 * * *")
@SchedulerLock(name = "txnConsolidatedMailSchedulerOne", lockAtMostForString = "PT15M")
public void txnConsolidatedMailSchedulerOne() {
    userTxnConsolidatedMail();
}

@Scheduled(cron = "0 00 19 * * *")
@SchedulerLock(name = "txnConsolidatedMailSchedulerTwo", lockAtMostForString = "PT15M")
public void txnConsolidatedMailSchedulerTwo() {
    userTxnConsolidatedMail();
}

@Scheduled(cron = "0 00 20 * * *")
@SchedulerLock(name = "txnConsolidatedMailSchedulerThree", lockAtMostForString = "PT15M")
public void txnConsolidatedMailSchedulerThree() {
    userTxnConsolidatedMail();
}

0 个答案:

没有答案