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();

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值