首页 > 其他分享 >Spring 中定时任务cron表达式问题

Spring 中定时任务cron表达式问题

时间:2022-11-16 13:47:46浏览次数:51  
标签:Scheduled Spring cron 定时 2099 表达式

1.问题:Cron expression must consist of 6 fields (found 7 in “0/5 * * * * ? *“)

@Scheduled(cron = "0/5 * * * * ? *")

2.原因:年的项1099~2099年,为默认。因此只需要6 个。
3.解决:去掉末尾 关于年的 *
改前:

0/5 * * * * ? *

改后:

0/5 * * * * ?

标签:Scheduled,Spring,cron,定时,2099,表达式
From: https://www.cnblogs.com/cainiaotoutou/p/16895587.html

相关文章