HangfireIO / HangfireIO/Hangfire

BackgroundJobClient.Enqueue Appears To Be Ignoring Queue Parameter

Open
#2,384 1 comment 0 reactions 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.