HangfireIO / HangfireIO/Hangfire
Problem with a job that is enqueued multiple times on azure web app
- Dominant language
- C#
- Stars
- 10.1k
- Forks
- 1.8k
- Avg merge
- 1h 19m
- Merged PRs (30d)
- 1
Description
I have a job that is defined like this:
```
RecurringJob.AddOrUpdate("Elastic_cleanup",
e => e.DeleteInvalidDocuments(null!, CancellationToken.None), "* 3 * * *");
```
My hangfire setup in program.cs looks like this:
```
builder.Services.AddHangfire(configuration => configuration
.SetDataCompatibilityLevel(CompatibilityLevel.Version_170)
.UseSimpleAssemblyNameTypeSerializer()
.UseRecommendedSerializerSettings()
.UseConsole()
.UseSqlServerStorage(builder.Configuration.GetConnectionString("AddressDatabase"))); ;
builder.Services.AddHangfireServer();
app.UseHangfireDashboard("/hangfire", new DashboardOptions
{
Authorization = new[] { new HangfireAuthorizationFilter() }
});
```
The HangfireAuthorizationFilter is just a IP limiter.
I am running the latest versions of hangfire and hangfire.sqlserver.
My classes are injected as Transient
`builder.Services.AddTransient();`
I only have one server:

I only have one instance of the web app in Azure:

Every morning my queue looks like this:

Have I setup anything wrong or is this a bug ?
I am using the same setup other places, where I don't have any issues.
I hope you can help me.
Contributor guide
Research direction
Start in Program.cs with the RecurringJob.AddOrUpdate call, AddHangfireServer registration, and UseSqlServerStorage configuration. Reproduce the recurring job behavior in the Azure web app setup shown, then inspect the queue and server configuration to determine whether repeated enqueueing is expected or indicates a configuration problem. Done means documenting the cause and the required setup change or confirming a reproducible Hangfire bug.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp, sql
- Domain
- backend, cloud, distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100