-1

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

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

"0/4220 * * * * ?"

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

4

1 回答 1

0

在这种情况下,我们可以使用简单的触发器来代替 Quartz cron。

在简单的触发器中,我们可以根据需要使用如下。

我们可以将整个事情转换为秒,我们可以重复它。

对于 15 分 10 秒,我已经使用如下。甚至我们也可以在几分钟内完成转换。

 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(); 
于 2017-04-24T13:12:43.197 回答