Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[Scheduler] Throw error on duplicate schedule provider service registration on the schedule name#60253
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
[Scheduler] Throw error on duplicate schedule provider service registration on the schedule name#60253
Conversation
A similar Q&A discussion from last year can be foundhere |
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.
Nice, this makes sense. I agree, let's call this a feature. Can you add an entry to the scheduler's CHANGELOG?
@kbond Sure! Hope the message within the changelog is OK and detailed enough. |
…ration on the schedule name
d7c2ace
to8548aac
CompareThank you@adrianrudnik. |
f8e605c
intosymfony:7.4Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
The way the schedule providers work, either by tagging a service or using theAsSchedule attribute, can lead to a scenario where multipleScheduleProviders register for the same schedule name (e.g.
default
).The problem arises when theCompilerPass simply overwrites the previously registered one without throwing a warning, a notice or anything else. The problem would be that a full ScheduleProvider would simply not register and therefore not run.
I decided to use the InvalidArgumentException from DI, as I could not get a trigger_error on E_USER_WARNING to show anything in a
dev
environment, in case I miss a scenario where this would actually be a desirable use case.Not sure if the test is complete enough for this scenario. I tried to base it on others found in HttpKernel.
Also not sure if this falls under "feature" or "bug fix", so I marked it as a feature above.