Tes*_*ult 6 cron spring-scheduled spring-boot
我的作业每隔指定的时间运行一次,但它每隔指定的时间运行一次,例如,如果我将作业设置为在 22:54 运行,它将从 22:54:00 到 22:54:59 每秒运行一次。我希望它只在指定的时间运行一次...非常感谢任何帮助
我的代码:
@Scheduled(cron = "* 54 22 * * ?")
    public void getCompaniess() {
         System.out.println(new Date()+" > Running testScheduledMethod...");
    }
输出:
Thu Mar 12 22:54:00 GMT 2020 > Running testScheduledMethod...
Thu Mar 12 22:54:01 GMT 2020 > Running testScheduledMethod...
.....
Thu Mar 12 22:54:59 GMT 2020 > Running testScheduledMethod...
| 归档时间: | 
 | 
| 查看次数: | 1585 次 | 
| 最近记录: |