HangfireIO / HangfireIO/Hangfire
Recurring Jobs do not enqueue if they are not in the default queue
- Dominant language
- C#
- Stars
- 10.1k
- Forks
- 1.8k
- Avg merge
- 1h 19m
- Merged PRs (30d)
- 1
Description
I'm using Hangfire 1.5.3 and .NET 4.5.2
If I have the following project:
``` cs
// TestJob.cs
using Hangfire;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace HangfireRecuringQueueTest
{
public class TestJob
{
[Queue("MY_QUEUE")]
[DisableConcurrentExecution(5 * 60)]
public void Execute()
{
Console.WriteLine(1 + 1);
}
}
}
```
``` cs
// Startup.cs
using Hangfire;
using System;
using System.Threading.Tasks;
using Microsoft.Owin;
using Owin;
[assembly: OwinStartup(typeof(HangfireRecuringQueueTest.Startup))]
namespace HangfireRecuringQueueTest
{
public class Startup
{
public void Configuration(IAppBuilder app)
{
GlobalConfiguration.Configuration.UseSqlServerStorage("Hangfire");
app.UseHangfireDashboard();
app.UseHangfireServer(new BackgroundJobServerOptions
{
Queues = new[] { "MY_QUEUE", "default" }
});
RecurringJob.AddOrUpdate("my-recuring-job", (j) => j.Execute(), Cron.Minutely);
}
}
}
```
``` xml
```
Hangfire never en-queues the job that is setup in the startup class. Furthermore, jobs cannot be forcefully en-queued:

It looks like the Jobs are being created in the database:

If I remove the `[Queue("MY_QUEUE")]` Attribute, the task processes as expected:

Specifying the `queue` parameter doesn't seem to work either:
``` cs
RecurringJob.AddOrUpdate("my-recuring-job", (j) => j.Execute(), Cron.Minutely, queue: "MY_QUEUE");
```
Contributor guide
Assessment
This issue has not been assessed yet.