Skip to content

v0.2.0

Choose a tag to compare

@rasupit rasupit released this 13 Apr 04:43
· 4 commits to main since this release

Hangfire.RecurringJobs v0.2.0

Breaking changes

  • AddRecurringJobDefinition(string, Job, string, ...) overload removed. Use the expression-based overload instead: AddRecurringJobDefinition<T>(id, x => x.Method(), cron).
  • RecurringJobDefinition.TimeZone is now TimeZoneInfo?. A null value means the job inherits RecurringJobsOptions.DefaultTimeZone at runtime.

New features

  • RecurringJobsOptions.DefaultTimeZone — set a shared timezone once in AddHangfireRecurringJobs(...) and all definitions without an explicit timezone inherit it automatically. Defaults to TimeZoneInfo.Utc.
  • RecurringJobsOptions.AutoRegisterOnStartup — opt-in flag (default: false). When enabled, all registered RecurringJobDefinition entries are automatically added to Hangfire storage on application startup via an IHostedService. Eliminates the need for a separate initializer class that manually calls IRecurringJobManager.AddOrUpdate.

Improvements

  • AddRecurringJobDefinition<T> timeZone parameter is now optional (defaults to null, inheriting DefaultTimeZone). Consumers no longer need to repeat a timezone on every definition.