Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.2k
[Scheduler] Add warning about comma-separated weekdays inPeriodicalTrigger
#21212
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
7cc7412
to47eed9d
Compare47eed9d
toc974e6d
ComparePeriodicalTrigger
scheduler.rst Outdated
@@ -286,6 +286,20 @@ defined by PHP datetime functions:: | |||
RecurringMessage::every('3 weeks', new Message()); | |||
RecurringMessage::every('first Monday of next month', new Message()); | |||
..warning:: |
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.
..warning:: | |
..note:: |
scheduler.rst Outdated
// With timezone (equivalent to the every() method with DateTimeImmutable): | ||
RecurringMessage::cron('5 12 * * 1,4,6', new Message(), 'Europe/Warsaw'); |
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.
// With timezone (equivalent to the every() method with DateTimeImmutable): | |
RecurringMessage::cron('5 12 * * 1,4,6', new Message(), 'Europe/Warsaw'); |
scheduler.rst Outdated
// Instead of this (not supported): | ||
RecurringMessage::every('Monday, Thursday, Saturday', new Message()); | ||
// Use this: | ||
RecurringMessage::cron('5 12 * * 1,4,6', new Message()); |
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.
// Instead of this (not supported): | |
RecurringMessage::every('Monday, Thursday, Saturday', new Message()); | |
// Use this: | |
RecurringMessage::cron('5 12 * * 1,4,6', new Message()); | |
..code-block::diff | |
- RecurringMessage::every('Monday, Thursday, Saturday', new Message()); | |
+ RecurringMessage::cron('5 12 * * 1,4,6', new Message()); |
c974e6d
to6a007d4
CompareThanks Wolfgang ... and congrats on your first Symfony Docs contribution 🎉 |
352ab1f
intosymfony:6.4Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Issue
symfony/symfony#60745
Users attempt to use comma-separated weekdays like "Monday, Thursday, Saturday" with RecurringMessage::every(), which causes silent failures due to PHP's DateInterval::createFromDateString()
Solution
Added a caution note in the PeriodicalTrigger section warning users about this limitation and providing the correct alternative using cron expressions.
Changes