Questions tagged [hangfire]

Hangfire is an open-source framework that helps you to create, process and manage your background jobs in .NET Framework and .NET Core.

Hangfire is an open-source framework that helps you to create, process and manage your background jobs in .NET Framework and .NET Core.:

  • mass notifications/newsletter
  • batch import from xml, csv, json
  • creation of archives
  • firing off web hooks
  • deleting users
  • building different graphs
  • image/video processing
  • purge temporary files
  • recurring automated reports
  • database maintenance

Background job type support:

  • Single use
  • Delayed
  • Recurring
  • Continuations

Persistent Storage via SQLServer, Redis, PostgreSQL, mongoDB or CompositeC1.

Hangfire is a .NET Framework alternative to Sidekiq, Resque, and delayed_job.

http://hangfire.io/

1297 questions
14
votes
1 answer

Hangfire - Multi tenant, ASP.NET Core - Resolving the correct tenant

I got a SaaS project that needs the use Hangfire. We already implemented the requirements to identify a tenant. Architecture Persistence Layer Each tenant has it's own database .NET Core We already have a service TenantCurrentService which…
Dekim
  • 604
  • 9
  • 23
14
votes
3 answers

Hangfire Automatic retries - how to manually configure the time between retries

I have a requirement to manually configure the time between retries. I was not able to find the way for it. But I found a code from https://github.com/HangfireIO/Hangfire/blob/master/src/Hangfire.Core/AutomaticRetryAttribute.cs which schedule job…
Mayank
  • 333
  • 1
  • 5
  • 15
13
votes
1 answer

What is the difference between the nuget packages hangfire.aspnetcore and hangfire and hangfire.core?

What is the difference between the nuget packages HangFire.AspNetCore and HangFire and HangFire.core? It seems I am able to use hangfire with a ASP .NET MVC Core project with only the HangFire 1.6.21 package alone. See below packages used in my…
Yahia
  • 805
  • 7
  • 25
13
votes
2 answers

Akka.NET actor system in ASP.NET

I created a service with a RESTful API in ASP.NET, hosted in IIS. Inside this service, I would like to create an actor system with Akka.NET. Upon creating the actor system: var actorSystem = ActorSystem.Create("myActorSystem"); The following…
Odsh
  • 697
  • 5
  • 20
13
votes
1 answer

Hangfire.Autofac with MVC app - injection fails

I'm trying to create a simple Hangfire test but it's not working. Here's all the important code, and how I've configured it with the Hangire.Autofac . Not sure what I'm missing here. The exception I'm getting in the /hangfire dashbaord is below…
parliament
  • 21,544
  • 38
  • 148
  • 238
12
votes
3 answers

Hangfire causing locks in SQL Server

We are using Hangfire 1.7.2 within our ASP.NET Web project with SQL Server 2016. We have around 150 sites on our server, with each site using Hangfire 1.7.2. We noticed that when we upgraded these sites to use Hangfire, the DB server collapsed.…
Raghav
  • 8,772
  • 6
  • 82
  • 106
12
votes
3 answers

Resolving Hangfire dependencies/HttpContext in .NET Core Startup

I've installed and configured Hangfire in my .NET Core web application's Startup class as follows (with a lot of the non-Hangfire code removed): public class Startup { public void Configuration(IAppBuilder app) { …
mellis481
  • 4,332
  • 12
  • 71
  • 118
12
votes
4 answers

Recurring jobs with Hangfire and Asp.Net Core

I have serivce which has some method which I would like to be Recurring job. I know that I can use hangfire in my Startup.cs e.g: RecurringJob.AddOrUpdate(() => Console.WriteLine("I'm a recurring job"), Cron.Minutely); But the question is how can I…
mskuratowski
  • 4,014
  • 15
  • 58
  • 109
12
votes
0 answers

Hangfire DistributedLockTimeoutException when calling the same static method concurrently

I have a web service that, when posted to, queues up downloads of images in Hangfire, so that if the image download fails, Hangfire will automatically retry: [AutomaticRetry(Attempts = 5, OnAttemptsExceeded = AttemptsExceededAction.Delete)] public…
Jimbo
  • 22,379
  • 42
  • 117
  • 159
12
votes
4 answers

ASP.NET Core MVC Hangfire custom authentication

I managed to work Hangfire on my ASP.NET Core MVC application, and now I am trying to add admin authorization. I added the following code to the Startup.cs file: app.UseHangfireDashboard("/hangfire", new DashboardOptions { Authorization = new[]…
Wasyster
  • 2,279
  • 4
  • 26
  • 58
12
votes
1 answer

Hangfire with multiple projects in .net solution

I am looking to implement hangfire into my asp.net web api and asp.net MVC website projects. The way I have structured my solution is as follows: Solution - My Solution 1: Model - (Project containing Entity Framework Objects and classes) 2:…
Zapnologica
  • 22,170
  • 44
  • 158
  • 253
11
votes
2 answers

How to use custom job name when using HangFire to start jobs that implement an interface

I'm attempting to use HangFire to schedule any class that implements a certain interface I have called IScheduledService. These services run as expected, but HangFire UI always shows the same name for each service in the HangFire dashboard…
Geekn
  • 2,650
  • 5
  • 40
  • 80
11
votes
3 answers

What is an correct way to inject db context to Hangfire Recurring job?

I'm using HangFire to send emails to users in the background, regularly. I'm obtaining email addresses from database, but I'm not sure whether I'm "injecting" database context to service that's responsible for sending emails correctly This works…
Joelty
  • 1,751
  • 5
  • 22
  • 64
11
votes
1 answer

Best practices for Hangfire on Azure

I am attempting to migrate an OnPrem solution to Azure. The application uses Hangfire fairly heavily. Hangfire is hosted in a windows service and is backed by SQL Server. I prefer not to remove this dependency unless absolutely required.…
Partha P. Das
  • 165
  • 3
  • 5
11
votes
2 answers

Check if HangFire.JobStorage is instantiated

I have a ASP.NET MVC Application that works as Hangfire client - it enqueues different jobs. I am using SqlServerJobStorage for Hangfire usage. For now i am working on a scenario when there is no connection to Hangfire Database, and somewhere in…
AlexSolovyov
  • 487
  • 2
  • 7
  • 22
1 2
3
86 87