-
Notifications
You must be signed in to change notification settings - Fork 2.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
Scheduler: fix Trigger#getNextFireTime() for cron-based jobs #41778
Conversation
mkouba
commented
Jul 9, 2024
- fixes quarkus-scheduler trigger getNextFireTime does not consider cron timezone #41717
@alanmscott it would be great if you could test this PR! |
This comment has been minimized.
This comment has been minimized.
Hi @mkouba I've had a test with the new SimpleScheduler. Whilst it is casting the Instant into the value correctly, it still has the problem where it can return a "nextFireTime" in the past. E.g.
As you can see, the local time (London time) is 09/07/2024 11:58. Is perhaps a problem with the value being returned by the underlying cronutils library? |
Hi @alanmscott, thanks a lot for testing this PR! You're right and I don't think it's the problem of cronutils. It's the way we adapt the next fire time because we retain the local date-time and change the timezone. Which is not correct. Let me try to fix that. Oh, timezones 🤦. |
@alanmscott Ok, another attempt. Note that I've removed the comparison of instants because it really depends on the current time. |
I think the latest change looks good. It's returning what I'd expect for the test harness:
Which is right. 17:06 for London = 18:06 for Berlin, so that is still "today", but has passed for Istanbul which is now "tomorrow". Fantastic, thank you!!! |
Status for workflow
|