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

Stop Hangfire starting a recurring job if it's already running

I have a list of recurring jobs set up in Hangfire, all with an interval of 20 minutes. They all call the same method, but with different parameters. e.g. Job ID test_1 => MyTestMethod(1) Job ID test_50 => MyTestMethod(50) Job ID test_37 =>…
Jimbo
  • 22,379
  • 42
  • 117
  • 159
11
votes
6 answers

Running background tasks periodically in an ASP.NET Core RC2 application

I'm working on an ASP.NET Core RC2 application. There is a requirement for this application to periodically invoke certain tasks, such as sending emails or invoking specific business logic. I'm aware that there are third-party libraries such as…
aw1975
  • 1,669
  • 3
  • 20
  • 35
11
votes
4 answers

How to get IIS site to start up automatically after deployment?

I have a Web API service that I'm deploying to my various environments (using Octopus Deploy). It is supposed to do various tasks on startup, e.g. run any migration scripts required by Entity Framework Code First, and some background tasks managed…
Shaul Behr
  • 36,951
  • 69
  • 249
  • 387
11
votes
1 answer

Difference between Hangfire background job and recurring job?

In Hangfire, what is the difference between a Background job and a recurring job? Because cron support is provided only in recurring job and not in background job?
user2613228
  • 242
  • 1
  • 4
  • 12
11
votes
5 answers

Using Hangfire, connection string given in Startup.cs throws Cannot attach file as database error

I'm utilizing Hangfire in my ASP .Net MVC Web App, it had installed successfully. I'd like to use the same LocalDb to store queued jobs for Hangfire to dequeue and process as I've used to stored data. However I'm running into the below error when I…
jerryh91
  • 1,777
  • 10
  • 46
  • 77
10
votes
2 answers

How to return a return value from Hangfire

I noticed this field in the Hangfire Dashboard for a succeeded job: I would love to shove some data in there, to give me more information about what the job did. How would I do that? I have searched google, checked the Hangfire documentation etc,…
Kjensen
  • 12,447
  • 36
  • 109
  • 171
10
votes
2 answers

Set Hangfire succeeded job expiry attribute not working

I am using Hangfire to do jobs, and I'd like to change the behaviour that succeeded jobs are deleted from the database after a day - I'd like them to be stored for a year. Following the instructions in this thread, which is the same as in this SO…
EluciusFTW
  • 2,565
  • 6
  • 42
  • 59
10
votes
2 answers

How to run only one job concurrently?

I have one hangfire server with ~50 recurring jobs. Hangfire setting up on IIS like in this example. Recurring jobs added to hangfire in startup.cs like this: RecurringJob.AddOrUpdate(job.desctiprion, () => job.startJob(), …
sintasy
  • 627
  • 11
  • 24
10
votes
2 answers

Scheduled tasks limitations (or how tasks persistence is implemented)?

I've started to read Hangfire documentation, and found nothing about task limitations. As declared, tasks (or jobs) are stored somewhere. Since they are just delegates, the only thing could be stored, as far as I understand, is a delegate "body"…
Dennis
  • 37,026
  • 10
  • 82
  • 150
10
votes
2 answers

Hangfire keeps running SQL queries even when inactive

I'm developing an ASP.net MVC 5 web site and I'm using Hangfire for scheduling some tasks, in this case just one every 3 min. I know for a fact that it takes only a few seconds to run such task (and the DB query associated with it). The problem I'm…
Luiso
  • 4,173
  • 2
  • 37
  • 60
9
votes
2 answers

Hangfire ContinueWithJob is stuck in awaiting state, though parent job has succeeded

I have a few jobs executed one after the other via ContinueJobWith(parentJobId, x => x.DoWork()). However, the second job is not getting processed and always sits in Awaiting state: The job itself is like this: Why this can happen and…
trailmax
  • 34,305
  • 22
  • 140
  • 234
9
votes
1 answer

Hangfire Clarification on SlidingInvisibilityTimeout

the hangfire docs state: One of the main disadvantage of raw SQL Server job storage implementation – it uses the polling technique to fetch new jobs. Starting from Hangfire 1.7.0 it’s possible to use TimeSpan.Zero as a polling interval, when…
Tim_Mac
  • 145
  • 1
  • 7
9
votes
3 answers

Is there any better way using hangfire with structuremap on ASP.net core?

I'm using structuremap with hangfire on asp.net core, no error on application but hangfire not process queue/schedule task even though data already on database. Here my snippet configuration public IServiceProvider…
Moch Lutfi
  • 552
  • 10
  • 27
9
votes
2 answers

Stop Hangfire job from enqueuing if already enqueued

Is there a simple way of stopping a hangfire.io job from enqueuing if one is already enqueued? Looking at the jobfilterattribute, nothing stands out as how to get the state of anything on the server. Can I use the connection objects and query the…
William
  • 1,375
  • 12
  • 27
9
votes
1 answer

How to access Failed Hangfire Jobs

I am currently working on EmailNotification module in which i have started using hangfire. The only issue is after trying 10 times, if hangfire fails to (schedule job) email in my case, there is not way i can find to get updates regarding that via…
vran
  • 163
  • 3
  • 11