HangfireIO / HangfireIO/Hangfire
BackgroundJobClient.Enqueue Appears To Be Ignoring Queue Parameter
- Dominant language
- C#
- Stars
- 10.1k
- Forks
- 1.8k
- Avg merge
- 1h 19m
- Merged PRs (30d)
- 1
Description
Given the following code:
```csharp
BackgroundJobClient.Enqueue("priority-analysis", dj=> dj.DoJob(null!, id, null));
```
Calling this:
```csharp
[Queue("analysis")]
public async Task DoJob(PerformContext? performContext, Guid testId, DateTime? _lastRun)
{
```
Will cause the job to end up in the "analysis" queue.
If I remove `[Queue("analysis")]` it just uses the default queue.
I'm using the default implementation of `IBackgroundJobClient` when injected via .NET 7.
Contributor guide
Research direction
Start at BackgroundJobClient.Enqueue and the default IBackgroundJobClient implementation used with .NET 7, then trace how the Queue attribute is applied to DoJob. Reproduce the enqueue with and without [Queue("analysis")] and inspect which queue is recorded; done means the queue behavior is explained or corrected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100