我有两个正在服务器中运行的节点。我的要求是,我需要运行一种方法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();
}