Hangfire.io支持对重复作业进行类似于CRON的调度.但是我如何指定特定的作业应该在特定的日期/时间运行一次,例如应该在2016年6月4日的16:22上运行作业-并且只能在该特定时间点进行?
Hangfire.io supports making a CRON-like scheduling of recurring jobs. But how do I specify, that a specific job should be run once, at a specific date/time, e.g. that a job should be run June 4th 2016, at 16:22 - and only at that specific point in time?
问相同问题的类似方法可能是:CRON表达式的子集描述了多大这里,由Hangfire支持吗?(所描述的CRON表达式支持可以使用的年份"字段.)
A similar way to ask the same question could be: how large a subset of the CRON expression described here, is supported by Hangfire? (The described CRON expression supports a "Year"-field which could be used).
此外,如果我使用Hangfire进行作业处理,那么您认为Hangfire首先是安排一次性批处理作业的最佳选择吗?
Also, do you think Hangfire is the best choice to schedule one-off batch jobs in the first place, provided that I use Hangfire for job processing?
推荐答案您可以使用BackgroundJob.Schedule(Expression> methodCall,DateTimeOffsetdt)方法.
You can use BackgroundJob.Schedule(Expression> methodCall, DateTimeOffsetdt) method.
BackgroundJob.Schedule(methodCall, enqueueAt);更多推荐
如何安排作业在Hangfire中的特定日期执行
发布评论