如何使用石英每隔70分钟发射一次cron调度程序? [英] How to fire a cron scheduler every 70th minute using quartz?

查看:73
本文介绍了如何使用石英每隔70分钟发射一次cron调度程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要每隔70分钟发一次cron时间表。例如,如果一个人在中午12:00开火,那么第二个应该是下午1:10,第三个应该是下午2:20,依此类推。我该如何实现这一目标? Cronmaker.com建议这样,0 0/70 * 1/1 *? *



但是当它超过60分钟时,它每小时才会发射一次。不是超过60的指定分钟。请建议。

I need to fire a cron schedule every 70th minute. For example if one fired at 12:00pm then 2nd one should be at 1:10pm and 3rd one should be at 2:20pm and so on. How do I achieve this? Cronmaker.com suggests this, 0 0/70 * 1/1 * ? *

But when it goes past 60 minutes, it only fires every hour. Not the specfied minute which is above 60. Please advice.

推荐答案

每70分钟 - 这不是一个适合cron触发器的工作 - 间隔/简单触发器怎么样



every 70 minutes - that's not really a job suitable to cron triggers - how about an Interval/Simple Trigger

trigger = TriggerBuilder.Create()
    .WithIdentity("your-trigger", "your-group")
    .WithSimpleSchedule(x => x
        .WithIntervalInMinutes(70)
        .RepeatForever())
    .Build();





(你可能需要) /想要一个.EndAt()子句)



(you might need/want a .EndAt() clause as well)


这篇关于如何使用石英每隔70分钟发射一次cron调度程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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