HangfireIO / HangfireIO/Hangfire
Recurring Job Queues
- Dominant language
- C#
- Stars
- 10.1k
- Forks
- 1.8k
- Avg merge
- 1h 19m
- Merged PRs (30d)
- 1
Description
I've got 2 applications both with their own recurring jobs and I need them to both run on the same SQL database. I've tried assigning queues to the jobs and I've set the BackgroundJobServerOptions.Queues to the queue names I want each app to work from, however both apps are picking up every recurring job and there doesn't seem to be anything in the actual queues (all jobs go into DEFAULT)
This is on app 1:
```
RecurringJob.AddOrUpdate("Job_app_1", job => job.Run(), Cron.Hourly, TimeZoneInfo.Local, "app_queue_1");
app.UseHangfireServer(new BackgroundJobServerOptions
{
Queues = new [] { "app_queue_1" }
});
```
This is on app 2:
```
RecurringJob.AddOrUpdate("Job_app_2", job => job.Run(), Cron.Hourly, TimeZoneInfo.Local, "app_queue_2");
app.UseHangfireServer(new BackgroundJobServerOptions
{
Queues = new [] { "app_queue_2" }
});
```
Contributor guide
Research direction
Start with the RecurringJob.AddOrUpdate calls and BackgroundJobServerOptions.Queues configuration shown for app 1 and app 2, then reproduce both applications against the same SQL database. Check how app.UseHangfireServer handles recurring jobs and queue assignment; done means each application processes only its intended recurring jobs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, sql
- Domain
- backend, databases, distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100