HangfireIO/Hangfire

Add proper support for time intervals in recurring jobs

開放

#1,054 建立於 2017年11月10日

 (2 則留言) (5 個反應) (0 位負責人)C# (1,748 個分叉)batch import
a: corehelp wantedt: feature-request

倉庫指標

星標
 (10,068 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Since Cron.XXXInterval methods should be deprecated as per #1041, a question arises – how to handle intervals then? One could use ScheduledState to create a job and re-schedule after each completion. But this is not an obvious option, and could lead to much more non-obvious consequences like 5 retries or an original job caused 5 scheduled jobs to be created instead of 1 with a simple implementation.

Instead, recurring jobs should be modified to support the following recurring schemes (yes, there will be no support for seconds yet). This is just to handle simple cases, with a simple implementation. Since recurring job is a has, we could save backward compatibility without any problems.

  1. Every X minutes
  2. Every X hours at MM minutes
  3. Every X days at HH:MM
  4. Every X months at DD day at HH:MM

貢獻者指南