HangfireIO/Hangfire

Add proper support for time intervals in recurring jobs

Aberta

#1.054 aberto em 10 de nov. de 2017

 (2 comentários) (5 reações) (0 responsável)C# (1.748 forks)batch import
a: corehelp wantedt: feature-request

Métricas do repositório

Stars
 (10.068 estrelas)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

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

Guia do colaborador