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
20
votes
3 answers

Why is Hangfire requiring authentication to view dashboard

I am running HangFire within my MVC web app but whenever I try to navigate to http://MyApp/hangfire, it redirects me to my app's login page as though I am not logged in. I have not explicitly configured any requirements for authorization...e.g. I…
crichavin
  • 4,672
  • 10
  • 50
  • 95
19
votes
5 answers

Set an "on demand" only job in HangFire

In Hangfire, I have successfully set recurring jobs and am able to trigger manually if I want to, thanks to the Web UI and its "trigger" button. RecurringJob.AddOrUpdate(..); But I'm willing to set a job that is never fired automatically. Only on…
Askolein
  • 3,250
  • 3
  • 28
  • 40
18
votes
2 answers

How to force hangfire server to remove old server data for that particular server on restart?

I am showing list of hangfire servers currently running on my page. I am running hangfire server in console application but the problem is when I don't have my console application running still hangfire api returns hangfire servers. Moreover when I…
I Love Stackoverflow
  • 6,738
  • 20
  • 97
  • 216
18
votes
2 answers

Hangfire single instance recurring job

I am trying to use Hangfire to run a recurring job in the background that polls data from another website, the issue is that I don't want the recurring job to run if the previous job is still running. I've read through the documentation but can't…
devfunkd
  • 3,164
  • 12
  • 45
  • 73
17
votes
2 answers

Hangfire .NET Core - Get enqueued jobs list

Is there a method in the Hangfire API to get an enqueued job (probably by a Job id or something)? I have done some research on this, but I could not find anything. Please help me.
RisingHerc
  • 694
  • 1
  • 9
  • 26
17
votes
2 answers

Hangfire Dashboard Authorization Config Not working

I've downloaded the nu-get package Hangfire.Dashboard.Authorization I'm trying configure the OWIN based authorization as per the docs as follows but I get intellisense error DashboardOptions.AuthorizationFilters is obsolete please use Authorization…
adam78
  • 9,668
  • 24
  • 96
  • 207
17
votes
4 answers

How to prevent a Hangfire recurring job from restarting after 30 minutes of continuous execution

I am working on an asp.net mvc-5 web application, and I am facing a problem in using Hangfire tool to run long running background jobs. the problem is that if the job execution exceed 30 minutes, then hangfire will automatically initiate another…
John John
  • 1
  • 72
  • 238
  • 501
17
votes
1 answer

Hangfire Background Job with Return Value

I'm switching from Task.Run to Hangfire. In .NET 4.5+ Task.Run can return Task which allows me to run tasks that return other than void. I can normally wait and get the result of my task by accessing the property…
yazanpro
  • 4,512
  • 6
  • 44
  • 66
16
votes
2 answers

Cancel or Delete Scheduled Job - HangFire

I have scheduled a Job via using Hangfire library. My scheduled Code like below. BackgroundJob.Schedule(() => MyRepository.SomeMethod(2),TimeSpan.FromDays(7)); public static bool DownGradeUserPlan(int userId) { //Write logic here …
Vijjendra
  • 24,223
  • 12
  • 60
  • 92
16
votes
3 answers

How do I get the current attempt number on a background job in Hangfire?

There are some database operations I need to execute before the end of the final attempt of my Hangfire background job (I need to delete the database record related to the job) My current job is set with the following…
Jimbo
  • 22,379
  • 42
  • 117
  • 159
16
votes
2 answers

Execute a recurring job in Hangfire every 8 days

Is it possible to create a recurring job in Hangfire that executes after a given number of days, say 8. The nearest I found was to execute a job once in a week - RecurringJob.AddOrUpdate("MyJob",() => ScheduledJob(), Cron.Weekly()); Understanding…
Yogi
  • 9,174
  • 2
  • 46
  • 61
15
votes
4 answers

Getting SQL Server error while using Hangfire

I am using Hangfire in an ASP.NET MVC5 application to send an email. Until now, it was working fine, but now when I run the application, it is throwing this error: There is already an object named 'Job' in the database.nstalling Hangfire SQL…
Dreamer
  • 586
  • 3
  • 7
  • 23
15
votes
1 answer

Set up JWT Bearer Token Authorization/Authentication in Hangfire

How can you configure Bearer Token Authorization/Authentication in Hangfire? I have a custom authentication filter that read the Authentication Token on the initial request but all other requests (Hangfire calls) it return 401. How can I attach…
Valter
  • 2,859
  • 5
  • 30
  • 51
15
votes
1 answer

Update method time in HangFire RecurringJob?

I just discovered that with HangFire you can have background jobs running in your .Net application but when I was testing its functionalities, I realized that the time in the method I added to a 1 minute RecurringJob does not change even though the…
Oluwafemi
  • 14,243
  • 11
  • 43
  • 59
15
votes
3 answers

In HangFire, can I Enqueue with a queue name instead of using the Queue attribute?

This documentation says that you can specify a queue by using the Queue attribute on the method to be invoked. This assumes that you always want execute a method on the same queue. Is there a way for the process that calls Enqueue to specify the…
Suraj
  • 35,905
  • 47
  • 139
  • 250
1
2
3
86 87