【问题标题】:Translating and understanding the @Scheduled cron message翻译和理解@Scheduled cron 消息
【发布时间】:2020-04-14 11:58:43
【问题描述】:

我有这个代码。

cron 消息的意思是“每周日凌晨 1 点执行此方法”。还是我翻译错了?

@Scheduled(cron = "0 1 0 * * ?")
private void notificationsScheduler() {
    //implementation
}

【问题讨论】:

    标签: spring methods cron scheduled-tasks implementation


    【解决方案1】:

    你错了,意思是每天。

    【讨论】:

    • 喜欢:2019-12-24 00:01:00 2019-12-25 00:01:00 2019-12-26 00:01:00 2019-12-27 00:01:00 2019-12-28 00:01:00 2019-12-29 00:01:00
    【解决方案2】:

    你的表情

    "0 1 0 * * ?" 
    

    表示:每天早上 00:01:00

    根据您的要求:每个月的每周日上午 01:00:00

    用途:

    0 0 1 ? * SUN *
    

    关注https://www.freeformatter.com/cron-expression-generator-quartz.html了解更多详情。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-08-02
      • 2013-03-30
      • 1970-01-01
      • 2016-05-24
      • 2014-12-20
      • 2021-06-01
      • 2014-06-29
      相关资源
      最近更新 更多