-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues recurring job #1832
Comments
Hangfire Team, we are observing the same issue. Our Hangfire job is set for running every hour, though we see that job run at multiple time within that one hour, maximum 20 times. Is this an existing issue, please acknowledge it, our production is getting impacted. |
Hangfire Team, Let me know if other details are required. sachin |
Anything Hangfire team. |
Please see https://en.wikipedia.org/wiki/Cron
|
@odinserj We are seeing hangfire starting another thread while the main is in progress. Maximum count reaches to 20. This has nothing to do with cron job expression. Do you need any more details then explanation in 1197 ? |
Try to use attribute from this gist – https://gist.github.com/odinserj/a6ad7ba6686076c9b9b2e03fcf6bf74e [SkipWhenPreviousJobIsRunning]
public void YourBackgroundJobMethod()
{
// ...
} In this case new background job will not be created if recurring job is still running. |
We will try this and let you know our outcome @odinserj |
@odinserj Which nuget package/version have SkipWhenPreviousJobIsRunning option so we can try ? |
@odinserj We tried SkipWhenPreviousJobIsRunning but it did not work. Can this be used with in memory Hangfire job setup or it needs only Redis or some sql storage? |
Please post here all the configuration logic related to Hangfire. All NuGet packages related to Hangfire and their versions. Please include screenshots of Dashboard UI for affected jobs. The problem is I still don't understand what's happened – two issues totally unrelated to each other were referenced without much details. And my assumption was based only on a regular issue when recurring job is based on a long running method that takes more time to be processed than its recurring interval. Please try to describe the problem. The more words the better, because I will be able to catch more facts. Describe both actual and expected behaviors. And last – if you are using Hangfire.MemoryStorage for your in-memory setup, try to use Hangfire.InMemory instead – https://github.com/HangfireIO/Hangfire.InMemory |
Hi every one,
I am having an issue with my cron job for automatically sending email.
Firstly, As a user I set the time for the job to send an email every 50 minutes, starting 9.00am.
The job is working fine at 9.50am and I can receive an email.
The Next email is expected to be sent in the next 50 minutes. But the problem is:
At 10.00am, an email is sent. After that, 10.50am, an email is sent.
At 11.00am, an email is sent. After that, 11.50am, an email is sent.
if (entity.Minute <= 59) { RecurringJob.AddOrUpdate($"RecurringNotAppear-{entity.Id}", () => SendMail(entity), $"*/{entity.Minute} * * * *"); return; }
The text was updated successfully, but these errors were encountered: