HangfireIO / HangfireIO/Hangfire

Recurring Jobs do not enqueue if they are not in the default queue

Open
#508 2 comments 0 reactions 0 assignees View on GitHub
t: question
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:

![image](https://cloud.githubusercontent.com/assets/794251/12566435/9cc143b8-c387-11e5-82d3-1c704099155e.png)

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

![image](https://cloud.githubusercontent.com/assets/794251/12566461/c24cd0fc-c387-11e5-9b43-cc6f9cd2ddb5.png)

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

![image](https://cloud.githubusercontent.com/assets/794251/12566494/f9b30f2a-c387-11e5-8898-fd6da7aed728.png)

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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.