cron表达式每隔1小时一次,Quartz Cron表达式:立即开始(每隔1小时10分钟20秒运行一次作业)...

阅读: 评论:0

cron表达式每隔1小时一次,Quartz Cron表达式:立即开始(每隔1小时10分钟20秒运行一次作业)...

cron表达式每隔1小时一次,Quartz Cron表达式:立即开始(每隔1小时10分钟20秒运行一次作业)...

I want to run a job every 1 hr 10 minutes and 20 seconds.

For this i have tried with the following cron expression.

"0/4220 * * * * ?"

But I cannot set more than 60 seconds.

what will be the cron expression for the above need?

解决方案

Instead of Quartz cron, we can use the simple trigger for this scenario.

In simple trigger we can use based on our need like the following.

We can convert the whole thing as seconds and we can repeat it.

For the 15 minutes and 10 seconds, I have used like the following. Even we can convert in minutes itself.

ITrigger trigger = TriggerBuilder.Create()

.WithIdentity("trigger3", "group1")

.WithSimpleSchedule(x => x

.WithIntervalInSeconds(910)

.RepeatForever()) // note that 10 repeats will give a total of 11 firings

.ForJob(job) // identify job with handle to its JobDetail itself

.Build();

本文发布于:2024-02-01 20:00:15,感谢您对本站的认可!

本文链接:https://www.4u4v.net/it/170678881439098.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:表达式   每隔   小时   作业   cron
留言与评论(共有 0 条评论)
   
验证码:

Copyright ©2019-2022 Comsenz Inc.Powered by ©

网站地图1 网站地图2 网站地图3 网站地图4 网站地图5 网站地图6 网站地图7 网站地图8 网站地图9 网站地图10 网站地图11 网站地图12 网站地图13 网站地图14 网站地图15 网站地图16 网站地图17 网站地图18 网站地图19 网站地图20 网站地图21 网站地图22/a> 网站地图23