Spring Cron scheduler “disable pattern”

前端 未结 3 461
感动是毒
感动是毒 2020-12-20 11:12

My application loads some cron patterns from a properties file. I\'m using the @Scheduled annotation like this:

@Scheduled(cron = "${config.         


        
3条回答
  •  眼角桃花
    2020-12-20 12:05

    If it was a cron expression, you could have used below which makes the cron run on 2099

    59 59 23 31 12 ? 2099
    

    But spring scheduler does not take a year as input. This is what I have found to defer it for some extended period. Below will run on 29 Feb which will be a leap year.

    0 0 0 29 2 ?
    

提交回复
热议问题