Quartz Cron表达式:立即开始(每隔1小时10分钟20秒运行一次作业) [英] Quartz Cron Expression: Run Job Every 1 hr 10 minutes 20 seconds starting NOW (immediately)

查看:4621
本文介绍了Quartz Cron表达式:立即开始(每隔1小时10分钟20秒运行一次作业)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想每隔1小时10分20秒运行一次工作。

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

为此,我尝试了以下cron表达式。

For this i have tried with the following cron expression.

"0/4220 * * * * ?"

但是我不能设置超过60秒。
满足上述需求的cron表达式是什么?

But I cannot set more than 60 seconds. what will be the cron expression for the above need?

推荐答案

我们可以使用简单的代替Quartz cron的方法

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.

在15分钟10秒中,我使用了以下内容。

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

这篇关于Quartz Cron表达式:立即开始(每隔1小时10分钟20秒运行一次作业)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆