I have set the cron expression to /45 * * * * * so that it can run every 45 seconds
Below is the code for the same
RecurringJob.AddOrUpdate(
x => x.DoWork(), "/45 * * * * *");
What I observed is it configures the next execution e.g at 07:08:45 sec and when it executes it should ideally set next execution at 07:09:30 sec but it sets 07:09:00 means it executes after 15 seconds and then it again sets next execution to 07:09:45.
so what i observed is always sets execution at hh:mm:45 and hh:mm+1:00
So I am not getting the expected output to set recurring job every 45 sec?
It would be really helpful if any one has came across this issue and has got any solution to this.
Hangfire.Core Version used 1.7.6
HangFire.SqlServer version used 1.7.6
HangFire.AspNetCore version used 1.7.6
Application is console application with TargetFramework : .NetCore 2.2
As far as I know, Cron jobs only goes down to minute granularity.
That seems to be the case for hangfire recurring tasks as well:
A special component in Hangfire Server (see Processing background jobs) checks the recurring jobs on a minute-based interval and then enqueues them as fire-and-forget jobs.