-
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
RecurringJob triggers on startup, outside cron expression? #1448
Comments
Hi @rasmuseeg, This is a strange behavior, since I've never seen that happening for years. The AddOrUpdate method just register a recurring job, without execute anything else. I see 2 possible reasons for this behavior: 1 - You have already a HangfireMediator.Send() task enqueued in the database, so when the service starts, it is executed. 2 - You have another piece of code that is expliciting doing a Enqueue() or Schedule() of your method. If you are able to provide a repository with this problem ocurring, I can try to help you figure it out 😄 Kind regards |
Hi there, I'm having the same problem on the latest version. Here's a more or less simple repro:
The same outcome, if the job was created at 16:00, but never executed.
Expected result: |
Funny I just came to same conclusion yesterday, but you beat me to it here. Thanks! 😁 |
@tukaef, what about previous versions? |
any updates on this? I am getting the same issue. |
@rsilvanet @odinserj |
I just experienced this. Our cron job is scheduled to run Mon-Sat. Our hangfire server was rebooted on Sunday and a task ran which we do not want to run on Sundays. |
No updates on this? |
any updates? |
I've got the follow code, which is inside my startup.cs class
It is registered as expected, but it also triggers the the method to run. Even though I've specified between 2-3 AM. The job has not yet been finished successfully, with the last 24 hours.
If the job was successfully run, within the last 24 hours, it appears to not run during startup.
How to i stop it from triggering outside the specified hours?
The text was updated successfully, but these errors were encountered: