HangfireIO / HangfireIO/Hangfire
Hangfire runs recurring job on addorupdate
- Dominant language
- C#
- Stars
- 10.1k
- Forks
- 1.8k
- Avg merge
- 1h 19m
- Merged PRs (30d)
- 1
Description
I have some recurring jobs, there are execute when i change the cron setting.
I can reproduce the problem with the follow steps:
* Create an Recurring Job with the CronExpression "15 2 1 1/3 *" and TimeZone "TimeZoneInfo.Local"
* Execute the Job and Set the LastExecutionTime in Database with the Value "2020-01-01T01:15:01.4982303Z". It must be this value.
* Update the Recuring Job with the to code "RecurringJob.AddOrUpdate()" to the CronExpression "15 2 1 1/6 *"
The effect is, that the job will be executed imediatly.
Why that. I think, that the job it should'nt executet now.
If i try the same with the LastExecutionTime "2020-01-01T01:50:02.7572580Z". Then the job is not executed.
Contributor guide
Research direction
Start at the RecurringJob.AddOrUpdate() entry point and trace how the recurring scheduler uses LastExecutionTime when the cron expression changes. Reproduce the two supplied cron and timestamp cases, then verify that updating the job does not enqueue it immediately when the next scheduled occurrence is not due.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100