The RecurringJobScheduler should be able to set a job to reoccur every X seconds.
There is support for this in NCrontab see #7, although a build has not yet been released.
I think it would involve making a change here, such that CrontabSchedule.Parse takes a second options argument, where you specify that you want to recognise six-part crontab expressions.
This would be great :+1:
Unfortunately, that change is proposed to be included in 2.0 version only (it hasn't released yet). I asked @atifaziz about his plans to release it here, so let's wait for the answer.
In case of unresolved conversation, we can fork the project and make the NCrontab2 package, but let's wait first.
NCrontab 2.0 released! Now we need to prepare Hangfire's RecurringJobScheduler, because it wakes up only every minute now. And there should be some caching mechanism, because it is terrible to query job storage every one second.
Good that it has been released. And I agree, it would be terrible to query every second. I do need to schedule some jobs to run every 20 seconds, or every 45 seconds.
Just curious - what kind of background processing do you want to perform every 20 seconds?
Emailed you separately about that :secret:
In my case in will be summarizing data from a ElasticCache and sending it to a Splunk System
Hi, I am currently testing 1.40, but I cannot see that it was updated. Hangfire works great, but I have one job that needs to run everything 30 seconds..Is there a workaround to this?
Thanks in advance. :+1:
Hi @bahram-hodjaev i tested this and this does not work,
this will only run the job once.
any update on this? i have a job that needs to run every 30 seconds.
Thanks in advance :)
Is there an update on this?
I'll probably try the Enqueue/Schedule trick, but if Hangfire internally only works in minutes, then that's not gonna work.. :/
how about enqueue delayed jobs in every minute? if 5 second granularity needed there will be 30 jobs every minute
This is also something we'd be interested in as the hacks we have in place at the moment are a little hampering
This would be a very useful feature!
This feature would be awesome!! 馃憤
I believe this is coming with Cronos
Does anyone know when we can expect this release?
This is a log awaited feature, we'd use it immediately!
袨褔械薪褜 卸写褍!
Support for seconds implemented in the latest betas of 1.7.0 so you can just pass six-part cron expression and it will work. However, you'll need to tweak the BackgroundJobServerOptions.SchedulePollingInteval option correspondingly to avoid extra delays, because default polling interval is 15 seconds.
Most helpful comment
Support for seconds implemented in the latest betas of 1.7.0 so you can just pass six-part cron expression and it will work. However, you'll need to tweak the
BackgroundJobServerOptions.SchedulePollingIntevaloption correspondingly to avoid extra delays, because default polling interval is 15 seconds.