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.
1,300
questions
0
votes
0
answers
13
views
AddHangfireServer with additional processes
I am getting started with Hangfire and building it to run the background jobs in a console app instead of aspnet. I see that the sqlstorage has background processes and want to add an additional one. ...
0
votes
0
answers
22
views
Anonymous functions, delegates and lambda expressions aren't supported in job method parameters
I'm using Hangfire for first time on a .Net Core Application... I've wrote a Job like this:
using MyTask.Data;
using MyTask.Models;
namespace MyTask
{
public class CandleStickJob
{
...
0
votes
0
answers
5
views
Hangfire throws error "Violation of PRIMARY KEY constraint 'PK_HangFire_Hash'" when manually trigger job from the dashboard
We recently encountered an issue with Hangfire. Our project is utilizing the following package versions:
Hangfire.AspNetCore: 1.8.0
Hangfire.Core: 1.8.0
Hangfire.SqlServer: 1.8.0
The problem arises ...
2
votes
1
answer
87
views
+300
How to cancel executing Hangfire batch child jobs?
Problem
Simply put, BatchJob.Cancel doesn't cancel already-running child jobs, and they instead run to completion, but cancelling the child job by id (when it's running) using BackgroundJob.Delete ...
0
votes
0
answers
22
views
Changing Hangfire storage type on runtime
I have an Asp.Net Web API project that uses Hangfire. Here you can see its registration in Startup.cs --> ConfigureServices:
services.AddHangfire(configuration => configuration
....
0
votes
1
answer
22
views
How to segregate recurring jobs in Hangfire between two services
I have two different services that use the same Hangfire instance for scheduling recurring jobs. I am using 1 Hangfire dashboard. Service 1 adds one recurring job, while Service 2 adds three recurring ...
-1
votes
1
answer
54
views
Do hangfire recurring jobs need to be in program.cs?
I am using .Net 7 and Hangfire 1.8.5
Do all of hangfire's recurring jobs have to be listed directly in Program.cs ? Or can I abstract them out into a sub module? I'd rather have 20 recurring jobs in a ...
0
votes
0
answers
20
views
Hangfire Recurring job can't be scheduled
I am getting the below issue in my Hangfire recurring job after each 10 or 15 mins and every time I have to trigger my job manually and it starts working again for some time and then get the same ...
0
votes
0
answers
28
views
Hangfire .NET Core 3.1 background task schedule error
I have a background task in Hangfire configured daily at 16 o'clock, but Hangfire does not read the task at the correct time.
enter image description here
enter image description here
In the image the ...
1
vote
1
answer
52
views
Schedule MassTransit Publish in ASP.NET Core
I have an ASP.NET Core Web API publishing messages using MassTransit and I am adding Hangfire for scheduling. I would also like to be able to view the Hangfire dashboard. With the relevant ...
0
votes
0
answers
15
views
HangFire globalFilter Execution
I'm running hangfire 1.7.11 on a Asp.net Project deployed in multiples appServices with a single database and I'm adding a global filter in the initial configuration : .UseFilter(new myFilter()); I'm ...
0
votes
0
answers
13
views
Hangfire - prevent logging unnecessary "Succeeded" jobs (without tags)
Now that 2yrs has gone by since this related SO question was asked, is there a way to prevent Hangfire from logging "spammy" Succeeded jobs in the Dashboard - aside from using the HF Tags ...
0
votes
0
answers
21
views
hangfire in worker error some time after so (1 or 2 worker working)
Hangfire in worker count error
there are 700 job in Enqueue and 36 worker counts available and 36 process are processing
than add more job 500 in another Queues than worker are than working
properly 1 ...
0
votes
0
answers
28
views
How to cancel queued recurring a hangfire job if it has a previous active running job?
We have Hangfire job for downlading external files, the job recurring interval = 5 min.
Sometime job can take longer than a 5 min. So we need to cancel next queued job if it has active running job
We ...
0
votes
0
answers
30
views
Mixed datetime formats at [HangFire].[State], Data column
I recently joined a project that is using hangfire 1.6.20.
We are having some problems with our code, and I decided to enable hangfire dashboards to help me check what is gong on.
I am getting some ...
-1
votes
0
answers
24
views
My Hangfire job some time works and some time getting this error message
System.InvalidOperationException: Recurring job can't be scheduled, see inner exception for details.
---> Hangfire.Common.JobLoadException: Could not load the job. See inner exception for the ...
0
votes
0
answers
32
views
Hangfire Enqueue Fire-and-Forget Jobs
I'm facing an issue with Hangfire Enqueue Job in .NET core
My application is already running on the staging server and also implemented some hangfire jobs, we implement a new hangfire enqueue job on ...
0
votes
0
answers
18
views
Hangfire history graph shows only last hour of data
I have set recurring job which runs every minute. Realtime graph shows small bumps every minute and task does run. History graph shows only last hour (with incorrect count most of the time), e.g. ...
2
votes
0
answers
78
views
Unable to write data to the transport connection: Connection reset by peer with MySqlStorage
We are using Hangfire recurring job in .net core webapi with MySql Database as backend. Both are running on AZURE.
The job is add/update the data records into MySqlDatabase for every 30 mins. The ...
0
votes
1
answer
50
views
Hangfire jobs don't run at time of day
I got Hangfire working with various-minute intervals. (The timing of the initial job seems a bit random, but then works great thereafter.)
However, my time-of-day jobs are not firing at all.
using var ...
0
votes
1
answer
41
views
C# using Hangfire with Owin and TopShelf
I created a console application with TopShelf. Now I need to add Hangfire and Owin to activate the Hangfire dashboard. The problem is on my IAppBuilder instance that doesn't have any UseHangfire.
I ...
0
votes
0
answers
24
views
log all SQL queries that Hangfire sends to database
I am currently using Hangfire 1.8.4 in my project, with SQL Server as job storage (using Hangfire.SqlServer 1.8.4). I am trying to find a way to log all SQL queries that Hangfire sends to my SQL ...
0
votes
0
answers
38
views
Get failed jobs by date range in Hangfire
I need to get a list of failed jobs in the last hour as part of health checks. After some searching I came up with this
var failedCount = hangfireMonitoringApi.FailedCount();
hangfireMonitoringApi....
0
votes
2
answers
195
views
How do I allow access to HangFire Dashboard outside of localhost with basic user login and password?
I am trying to allow access to HangFire Dashboard from any location. I have added the following code:
app.UseHangfireDashboard("/hangfire", new DashboardOptions
{
Authorization = new[]
...
0
votes
1
answer
38
views
How to pass dependencies to an enqueued class through its constructor in Hangfire
I have a class called Car
public class Car : ICar
{
private readonly Driver driver;
private readonly EngineInfo engineInfo;
private readonly Logger logger;
public Car(Driver driver, ...
0
votes
1
answer
93
views
Is it possible to use HangFire without the Dashboard and Server options?
I have an asp.net core MVC site where I need to use hangfire, then I have a hangfire server.
I need to use the hangfire dashboard only on the server. But if I don't use the app.UseHangfireDashboard(), ...
0
votes
0
answers
21
views
Can I use Server Side URL to UI frame like Angular
I have an URL 'https://localhost:44311/hangfire'. When I am using that URL in browser directly it is rendering one Dashboard which is a Hangfire Dashboard. It is an in-build Dashboard provided by ...
-1
votes
1
answer
62
views
Is a C# WPF Hangfire Client possible?
I would like to enqueue Hangfire jobs from a WPF desktop application. Is this possible?
I currently have an api that talks to our Hangfire server but would like to bypass it to enqueue background ...
0
votes
1
answer
50
views
Hangfire (v1.8.4) favicon not being displayed
I'm using Hangfire version 1.8.4 to schedule some background processes, but when I fire the application it doesn't displays a default favicon.
This is how it's displayed right now:
Does someone know ...
0
votes
0
answers
24
views
How can i use Hangfire in Multi-Tenant App?
Currently i have single tenant app, that uses hangfire as background job.
Now we need to migrate this into multitenant architecture
Like
One App
One Db ( with clientId Filter)
Now we need to use ...
0
votes
0
answers
25
views
hosting multiple Hangfire Dashboards in one application without running inside it any jobs
I created a single application that hosts multiple Hangfire Dashboards for several storages. and I'm trying to understand which configuration is required for Hangfire to make it work.
For each storage ...
0
votes
1
answer
33
views
Update Hang-Fire default worker count from 20 to a custom number in ABP Framework
I would like to update the concurrent background job count from the default 20 to 10. Where can I mention this configuration ? There is this link which gives some information. But how do I configure ...
0
votes
1
answer
65
views
Execution of old Hang Fire jobs even after deleting the database
I ran into a strange problem. I used Hang Fire in a software under Blazor Server and .NET Core that I had no problem with, and now I have come across this problem that when I request to create any job,...
0
votes
0
answers
56
views
Hangfire Background job to requeue failed jobs unit test
I have created a Hangfire Background job that triggers the failed job as per some CRON schedule. I am facing issues to write Unit test case for the same, specially in mocking for 1st 2 lines. ...
1
vote
1
answer
95
views
Alternative to Hangfire in Azure world
i'm using from several time Hangfire with SQL and i don't have any problem.
Classic use cases that i will have are:
From a web app, user enqueue an operation and can check all pending operations. ...
0
votes
0
answers
43
views
I need to use hangfire in ASP.NET MVC
I need to use hangFire in ASP.NET MVC but I can't call backgroundService in ASP.NET MVC.
enter image description here
In .NET Core, I register it in the Startup file:
builder.Services.AddHostedService&...
0
votes
0
answers
26
views
How to terminate long running Hangfire job upon IIS app pool restart
We are using Hangfire to enqueue a long running background job from a .NET application in IIS. This long running background job listens to Azure service bus and processes the message using a function ...
0
votes
1
answer
63
views
SQLite database backup ASP.NET Core file locked
I have an ASP.NET Core 6 application that uses SQLite. I have a recurring Hangfire job that I'd like to use to back up the database using the online backup API of SQLite. Finally, I'd like to upload ...
0
votes
0
answers
101
views
How to leverage Hangfire in case of multiple microservices hosted in Azure Kubernetes Service?
I have three .NET 7 Microservices hosted within Azure Kubernetes Service. I have few background tasks that needs to be managed via Hangfire. Implementation of Hangfire in case of monolithic ...
0
votes
1
answer
193
views
Hangfire Service Not Running
I am trying to use Hangfire for background job in my ASP.Net Core 7 Web API project.
When I start the application and look at the console logs, it shows the following
which appears that the hangfire ...
1
vote
1
answer
84
views
Can Hangfire be configured to use multiple storage simultaneously?
I am using Hangfire in my application and I want to configure it to use Redis and Memory as the storage for different queues. The reason I want to do this is that I want to handle some tasks which are ...
0
votes
0
answers
55
views
App WebAssembly Blazor + Swagger + Hangfire broken routes
I'm fairly new to this stack. I've started with visual studio 2022 "App WebAssembly Blazor".
A simple db/api with a scheduled job. Everything in debug work as expected, but when deployed in ...
0
votes
0
answers
35
views
Hangfire Server start leads to inifite Loop in DI
When first navigating to my hangfire dashboard it must start the hangfire server and I end up in an infinite loop between these three scoped services: Repo, ResourceManager and SessionManager. The ...
0
votes
0
answers
67
views
How to change hangfire connection string at runtime
I set connection string in startup.cs but I need to change dbContext and hangfire connectionString according to httpContext request. I have some idea about dbContext but I don't have any idea about ...
0
votes
0
answers
54
views
Azure App service prefix missing when API end point is called through Swagger or Hangfire. API hosted in app service exposed through API gateway
The base URL of my azure app service is "https://appname.domain.com". On opening the URL "https://appname.domain.com/pipelineAPI/swagger/index.html" my swagger index.html page ...
0
votes
0
answers
14
views
how to fire specific hangFire jobs not all jobs in my project
I'm using hangFire Jobs and it works fine except that the jobs are more than the jobs I wanted in my code as follows:
public async Task<TResponse> Handle(TRequest request, CancellationToken ...
0
votes
0
answers
86
views
RecurringJob with multiple Queue and multiple server
I have multiple projects that run RecurringJob and do not share any assembly, so every job assembly exists in its project and not others. I configured every project with a unique queue in Hangfire and ...
1
vote
0
answers
120
views
How to delete queue from hangfire?
Can someone help me to figure out how to delete the queue from an enqueued job in Hangfire? I deleted all the jobs from the queue but the queues are still there. I found a way to achieve this by ...
0
votes
0
answers
58
views
.NET 6.0 console app hangfire recurring job with dependency injection for services used
I am trying to create a console app that schedules a recurring job with hangfire that will run a method from a service we made. This service is imported via a nugget we made for this library. It has ...
0
votes
0
answers
24
views
How to prevent Hangfire from running a job twice in staging server?
I have created a project on .net core 2.0. In my project there is a requirement i.e
In 11 AM & 5 PM I need to send Mail & Message to user in every day.
I have successfully configure Hangfire ...