Cron表达式无法按预期工作。

huangapple 未分类评论48阅读模式
英文:

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

Cron表达式无法按预期工作。

英文:

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

Cron表达式无法按预期工作。

huangapple
  • 本文由 发表于 2020年7月24日 16:14:40
  • 转载请务必保留本文链接:https://java.coder-hub.com/63069575.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定