英文:
Cron expression unable to work as expected
问题
我在项目中使用了Quartz调度器。
我设置了每4小时运行一次的cron表达式,但是任务仍然在每隔一分钟运行一次。
Cron表达式:
0 0 0/4 1/1 * ? *
英文:
I am using quartz scheduler in my project.
I put cron expression for every 4 hour, but still my job is running after every one minute.
Cronexpression:
0 0 0/4 1/1 * ? *
答案1
得分: 0
我认为以下是原因,请查找该文档:
>对于同时指定周几和月中某天的支持不完整(您目前必须在这些字段中的一个中使用“?”字符)。
实际上,我在在线cron测试器上尝试了您的cron表达式,返回了错误。
https://www.freeformatter.com/cron-expression-generator-quartz.html
英文:
I think following is the cause, please find the document:
>Support for specifying both a day-of-week and a day-of-month value is not complete (you must currently use the ‘?’ character in one of these fields).
Actually, I tried your cron expression on cron online tester, return error.
https://www.freeformatter.com/cron-expression-generator-quartz.html
专注分享java语言的经验与见解,让所有开发者获益!
评论