Skip to content

Latest commit

 

History

History
57 lines (41 loc) · 2.62 KB

File metadata and controls

57 lines (41 loc) · 2.62 KB
title category author redirect_from
Hangfire 0.9.0
release
odinserj
/release/2014/06/07/hangfire-0.9-released.html
/2014/06/07/hangfire-0.9-released.html

Recurring jobs

This version brings incredibly easy method of scheduling and running recurring jobs inside ASP.NET applications. You need to call only a single line of code to perform this task:

{% highlight csharp %} RecurringJob.AddOrUpdate(() => Console.Write("Easy!"), Cron.Daily); {% endhighlight %}

The Cron class provides different easy to use methods and overloads to set up recurring jobs on a minutely, hourly, weekly, monthly and yearly basis. It is also possible to use more complex CRON expressions, since the NCrontab library is used to perform scheduling logic.

{% highlight csharp %} RecurringJob.AddOrUpdate( () => Console.Write("Powerful!"), "0 12 * */2"); {% endhighlight %}

Hangfire will check the schedule each minute and enqueue recurring jobs as regular background jobs, so you receive all power of Hangfire, including the full transparency, free of charge.

Hangfire Monitor was also updated and allows you to see and manage your recurring jobs:

Recurring jobs

So, Hangfire now supports all kinds of background jobs: fire-and-forget, delayed and recurring, and let you process them with ease!

Changes

  • Added – Out-of-the-box support for running recurring jobs.
  • AddedSqlServerStorage now also accepts connection string names.
  • ChangedIBackgroundJobClient does not implement the IDisposable interface anymore.
  • ChangedIMonitoringApi does not implement the IDisposable interface anymore.
  • Changed – Improve DateTime resolution for job arguments by including milliseconds.
  • Changed – Removed deprecated RetryAttribute class. Please, use AutomaticRetryAttribute.
  • FixedKeyNotFoundException when accessing job cancellation token with Redis.
  • Fixed – Theoretical race condition that makes Hangfire Server invisible from Monitor.

Upgrading

Version 0.9 brings some breaking changes. Please, do the following steps to perform the upgrade.

  • Replace the RetryAttribute with AutomaticRetryAttribute.
  • Remove the calls to Dispose method of IBackgroundJobClient interface (or BackgroundJobClient class).
  • Remove the invocations of IMonitoringApi.Dispose method.

Links