An easy way to perform background job processing in .NET and .NET Core applications. No Windows Service or separate process required
JobStorage.Current
is not initialized.TypeHelperSerializationBinder
class public to use it from custom serializer settings.IJobCancellationToken
interface method (by @judah4).AddHangfireServer
.null
as result of StopAsync
in hosted service implementation (by @tomaszek92).RecurringJob.TriggerJob
method that returns identifier of a triggered background job.RecurringJobManager.TriggerJob
as a replacement for the TriggerExecution
method.RecurringJob
class.RecurringJob.Trigger
method is now obsolete, TriggerJob
is the replacement.RecurringJobManager.TriggerExecution
method is now obsolete, TriggerJob
should be used instead.Full Changelog: https://github.com/HangfireIO/Hangfire/compare/v1.7.30...v1.7.31
Job.Queue
property, so jobs now can have their own queue specified.IBackgroundJobClient.Create
method overloads with the new queue
parameter.JobContinuationOptions.OnlyOnDeletedState
to create continuations after a failure.JobContinuationOptions
values for a continuation.DisableConcurrentExecution
filter.ServerId
to FailedState
instances to simplify the debugging on different servers.MisfireHandlingMode.Strict
to create job for each missed recurring job occurrence.DeletedState
now have the persisted Exception
property populated after a failure.Exception
job parameter is passed to continuation when UseResultsInContinuations
method is used.FromExceptionAttribute
to deal with an antecedent exception in a background job continuation.AutomaticRetryAttribute
by using the new OnlyOn
property.Remove
method for JobFilterCollection
to remove global filters based on their type.IGlobalConfiguration.UseFilterProvider
extension method to unify the configuration.AttemptsExceededAction.Delete
option by default in the global automatic retry filter.BackgroundJobServerOptions.StopTimeout
to 500 ms.DeletedState
instead of SucceededState
when its invocation was canceled by a filter.AddOrUpdate
overloads with optional params defined in the RecurringJobManagerExtensions
class.AddOrUpdate
overloads with optional parameters defined in the RecurringJob
class.AddOrUpdate
method overloads with no recurringJobId
parameter.RecurringJobOptions.QueueName
property, new methods should be used instead.NET45
platform target in favor of NET451
target to support Visual Studio 2022.Dashboard UI
UseDarkModeSupportForDashboard
method (by @danillewin).DashboardRoutes
class.IGlobalConfiguration.UseJobDetailsRenderer
method for custom renderers for Job Details page.IGlobalConfiguration.UseDashboardMetrics
extension method to pass multiple metrics at once.DeletedState
to display its new exception property.default
one.Extensibility
Factory
, StateMachine
and Performer
properties to context classes to avoid injecting services.ApplyStateContext
and ElectStateContext
instances.JobFilterAttribute
instance to decrease payload size.Storage
JobStorage.GetReadOnlyConnection
method intended to return JobStorageConnection
for replicas.JobStorage.HasFeature
method for querying optional features.GetSetCount
and GetUtcDateTime
methods for the JobStorageConnection
class.AcquireDistributedLock
and RemoveFromQueue
methods for the JobStorageTransaction
class.CreateJob
method to the JobStorageTransaction
abstract class.SetJobParameter
method to the JobStorageTransaction
abstract class.JobStorageConnection.SetContains
method.ParametersSnapshot
property for BackgroundJob
and JobData
classes to minimize roundtrips in future.JobStorageMonitor
class with more available methods for the new features.Internals
IBackgroundProcess.UseBackgroundPool
now allows to pass thread configuration logic.BackgroundJobServerOptions.WorkerThreadConfigurationAction
option for custom thread configuration.FromParameterAttribute
-based logic now always overwrites arguments, even with non-null values.JobContinuationOptions
enum into flags while still possible.TaskExtensions.WaitOneAsync
only with the RegisterWaitForSingleObject
method.ServerHeartbeatProcess
now uses ThreadPriority.AboveNormal
to prioritize heartbeats.JobQueue.Id
column to use the bigint
type.System.Data.SqlClient
(by @0xced).SqlServerStorageOptions.DbProviderFactory
option to use custom provider factory.TryAutoDetectSchemaDependentOptions
option to automatically enable options based on schema.SqlServerStorage.SchemaVersion
metric for Dashboard UI.UseTransactionalAcknowledge
option).Connection.GetUtcDateTime
feature to make work new changes in schedulers.QueuePollInterval
option to TimeSpan.Zero
.QueuePollInterval
is set to zero now defaults to 200 ms.UseRecommendedIsolationLevel
option by default.GetJobData
now populates JobData.ParametersSnapshot
property to avoid additional round-trips.UsePageLocksOnDequeue
option is now obsolete and doesn't affect anything.NET45
platform target in favor of NET451
target to support Visual Studio 2022.NET45
platform target in favor of NET451
target to support Visual Studio 2022.IApplicationBuilder.UseHangfireServer
that accepts custom factory for IBackgroundProcessingServer
.SecurityException
as a non-catchable one.AspNetShutdownDetector
to avoid depending on thread pool.AspNetShutdownDetector
's check intervals to detect shutdowns earlier.RecurringJobManager.TriggerExecution
method that returns identifier of a created job.GetRecurringJobIds
extension method for JobStorageConnection
that returns only identifiers.DashboardMetric.Url
property to make it possible for metrics on the Overview page to be clickable (by @twinmind).DateOnly
and TimeOnly
in .NET 6.0 or other new types in CoreLib.OutOfMemoryException
or StackOverflowException
.ManualResetEvent
instance in BackgroundExecution
.Hangfire.Core
BackgroundJobStateChanger
to avoid infinite loops.Hangfire.SqlServer
UseDarkModeSupportForDashboard
method.DashboardRoutes
class.DisableConcurrentExecutionAttribute
.BackgroundJobServerOptions.StopTimeout
to 500 ms.TryAutoDetectSchemaDependentOptions
option to automatically enable options based on schema.GetJobData
now populates JobData.ParametersSnapshot
property to avoid additional round-trips.QueuePollInterval
is set to zero now defaults to 200 ms.UsePageLocksOnDequeue
option is now obsolete and doesn't affect anything.This security patch fixes a regression appeared in the previous version 1.7.25 that makes Dashboard UI available for remote requests in the default configuration, e.g. when no authentication filter specified. Please note that when custom authentication filter is defined as recommended in the documentation, everything works as expected, but upgrade is recommended in any case. Please read the GHSA-7rq6-7gv8-c37h security advisory for details.
Hangfire.Core
Hangfire.Core
HeartbeatInterval
option (by @GitHubPang).Hangfire.SqlServer
Server
table.Hangfire.NetCore and Hangfire.AspNetCore
AddHangfireServer
extension method in .NET Core.UseHangfireServer
method for targets where AddHangfireServer
one is available.