-
Notifications
You must be signed in to change notification settings - Fork 543
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed Issue with OFBiz Job Scheduler and Daylight Saving Time (OFBIZ-…
…12864) (#674) * Fixed recurring job not scheduling when DST change The issue occurs when DST changes, and OFBiz fails to schedule recurring jobs properly. This is due to a condition in the PersistedServiceJob.createRecurrence method where it compares the next scheduled time (next) with the start time (startTime) for the job. To address the issue, adding a new field named JobSandbox.runTimeEpoch. This field would store the UTC format epoch milliseconds of the runtime date. When scheduling or rescheduling recurring jobs, the system would use the UTC epoch stored in JobSandbox.runTimeEpoch for comparison. This solution ensures that the system uses a consistent, UTC-based time for scheduling and rescheduling recurring jobs, even when DST changes affect the local time. To implement this solution, you would need to: Modify the PersistedServiceJob.createRecurrence method to calculate and store the UTC epoch milliseconds in the JobSandbox.runTimeEpoch field. Update the code responsible for polling and rescheduling jobs to use the JobSandbox.runTimeEpoch field when it is set. If the field is not set, you would fall back to getting the runtime date to filter the jobs. By using this approach, system should be able to handle recurring job scheduling more reliably, especially when DST changes are involved, as it ensures that all time comparisons are made in a consistent UTC format. * Checkstyle fixes * Store the runTimeEpoch while recurring job scheduling
- Loading branch information
1 parent
2e084e7
commit 46701da
Showing
3 changed files
with
54 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters