# Console application does not fire recurring job

**URL:** <https://discuss.hangfire.io/t/console-application-does-not-fire-recurring-job/11316>\
**Category:** question\
**Tags:** recurring, memory-storage\
**Created:** [June 3, 2025, 12:52pm UTC](https://discuss.hangfire.io/t/console-application-does-not-fire-recurring-job/11316 "2025-06-03T12:52:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wilson](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/wilson/32/4000_2.png) [@Wilson](https://discuss.hangfire.io/u/Wilson)\
**Post date:** [June 3, 2025, 12:52pm UTC](https://discuss.hangfire.io/t/console-application-does-not-fire-recurring-job/11316/1 "2025-06-03T12:52:09Z")

</div>

I have a **console** application.

And I am using the latest version of the following 2 packages:

- Hangfire.Core 1.8.20
- Hangfire.MemoryStorage 1.8.1.1

And I have the following simple console application to run a simple function, with the following CRON:

> \*/2 \*/1 \* \* \* \*

Which is supposed to run every 2 seconds.

But it never fires.

Any idea?

using System.Linq.Expressions;  
using Hangfire;  
using Hangfire.MemoryStorage;

namespace TestJob  
{  
internal class Program  
{  
static void Main(string args)  
{  
var jobManager = new JobManager();  
jobManager.Start();

```
        Console.WriteLine("Hello, World!");
        Console.Read();
    }
}

class JobManager
{
    public void Start()
    {
        GlobalConfiguration.Configuration.UseMemoryStorage();

        var pulseCron = "*/2 */1 * * * *";
        AddJob(BackgroundJobs.Pulse, () => RunPulseJobAsync(), pulseCron);
    }

    private void AddJob(string jobId, Expression<Func<Task>> methodCall, string jobCron)
    {
        RecurringJob.AddOrUpdate(jobId, methodCall, jobCron);
    }

    [Queue(JobConstants.CriticalQueue)]
    public async Task RunPulseJobAsync()
    {
        var jobRunner = new PulseJob();

        await jobRunner.StartAsync();
    }
}

public sealed class PulseJob() : IJobRunner
{
    public string Id => BackgroundJobs.Pulse;

    public async Task StartAsync()
        => Console.WriteLine(DateTime.Now);
}

public interface IJobRunner
{
    public string Id { get; }

    Task StartAsync();
}

public static class JobConstants
{
    public const string CriticalQueue = "critical";
}

public static class BackgroundJobs
{
    public const string Pulse = "Pulse";
}

```

}

Even I followed [Processing Jobs in a Console Application — Hangfire Documentation](https://docs.hangfire.io/en/latest/background-processing/processing-jobs-in-console-app.html) to add the BackgroundJobServer, it still does not trigger:

```
    private BackgroundJobServer server;

    public void Start()
    {
        GlobalConfiguration.Configuration.UseMemoryStorage();

        server = new BackgroundJobServer();

        var pulseCron = "*/2 */1 * * * *";
        AddJob(BackgroundJobs.Pulse, () => RunPulseJobAsync(), pulseCron);
    }

```

If I use exactly what the official document says, then it runs, despite it runs every 15 seconds:

```auto
using System.Linq.Expressions;
using Hangfire;
using Hangfire.MemoryStorage;

namespace TestJob
{
    internal class Program
    {
        static void Main(string[] args)
        {
            var jobManager = new JobManager();
            jobManager.Start();

            Console.WriteLine("Hello, World!");
            Console.Read();
        }
    }

    class JobManager2
    {
        BackgroundJobServer server;

        public void Start()
        {
            GlobalConfiguration.Configuration.UseMemoryStorage();

            RecurringJob.AddOrUpdate("Test", () => DoSomething(), "*/2 */1 * * * *");

            server = new BackgroundJobServer();
        }

        public void DoSomething()
        {
            Console.WriteLine("2- " + DateTime.Now);
        }
    }
}

```

So, to conclude, what I have noticed are 3 things:

1. the minimum interval is every 15 seconds.
2. it does not work with queue.
3. it does not work with the job container class with parameters in constructor.

---

<div class="post-metadata">

**Author:** ![philipd](https://avatars.discourse-cdn.com/v4/letter/p/cc9497/32.png) [@philipd](https://discuss.hangfire.io/u/philipd)\
**Post date:** [June 3, 2025, 8:02pm UTC](https://discuss.hangfire.io/t/console-application-does-not-fire-recurring-job/11316/2 "2025-06-03T20:02:08Z")

</div>

If you want an interval that short (every 2 seconds), I believe that you need to set the “SchedulePollingInterval” (which defaults to every 15 seconds) to a shorter value (perhaps every 1 second).

See this documentation: [Calling Methods with Delay — Hangfire Documentation](https://docs.hangfire.io/en/latest/background-methods/calling-methods-with-delay.html)
