简体   繁体   English

Spring @Scheduled cron 作业

[英]Spring @Scheduled cron job

I am looking to fire off a task everyday at 9am.我希望每天早上 9 点完成一项任务。 I am getting some funky results.我得到了一些时髦的结果。 Currently my job looks like this:目前我的工作是这样的:

@Scheduled(cron = "0 0 9 * * ?")

What is going wrong with this?这有什么问题? Is this the correct expression?这是正确的表达吗?

I believe @Scheduled(cron="0 0 9 * * *") should work.我相信 @Scheduled(cron="0 0 9 * * *") 应该可以工作。 Also make sure that you are on right time zone.还要确保您在正确的时区。 Have a look at this video to know different possible ways to use cron expression with @Scheduled.观看此视频,了解在 @Scheduled 中使用 cron 表达式的不同可能方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM