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] Add DateIntervalTrigger and DatePeriodTrigger #49739
Conversation
89af9e9
to
ea3f6d3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth keep PeriodicalTrigger then? Can't we create one using the new trigger?
Maybe not. |
ea3f6d3
to
1fe329d
Compare
I've removed |
1fe329d
to
6844a3a
Compare
src/Symfony/Component/Scheduler/Trigger/DateIntervalTrigger.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Scheduler/Trigger/DateIntervalTrigger.php
Outdated
Show resolved
Hide resolved
6844a3a
to
c0816e3
Compare
c0816e3
to
9a4ee58
Compare
@fabpot It doesn't work in real cases. Period iterator iterates over the all time points from the begginng. For example, some create a period from "2023-03-21" on every second. At "2024-03-12" the period will iterate over 31536000 poins on every worker start. It is the reason why I wrote different version. Revert it, please. |
@upyx I'm on it. |
The
PeriodicalTrigger
should only be used for a fixed period of time that can be converted to a number of seconds.Using it for
DatePeriod
does not make sense as the number of seconds between 2 runs can differ.This PR introduces 2 new triggers that behave correctly in such cases.