Skip to content

[Scheduler] Postpone schedule creation #51138

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

Merged
merged 1 commit into from
Jul 29, 2023

Conversation

HypeMC
Copy link
Contributor

@HypeMC HypeMC commented Jul 28, 2023

Q A
Branch? 6.3
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #51112
License MIT
Doc PR -

The issue is caused by the MessengerTransportDoctrineSchemaListener which is triggered when doctrine:schema:create is run. It instantiates all transports which causes the ScheduleProviderInterface::getSchedule() method to be called, but since the schema is not yet created, everything breaks.

This PR changes the MessageGenerator class to accept the ScheduleProviderInterface instead of only Schedule. That way the call to getSchedule() can be postponed to when it's really needed, and since the Shedule class implements the ScheduleProviderInterface, there's no breaking change.

@@ -133,7 +133,7 @@
"doctrine/data-fixtures": "^1.1",
"doctrine/dbal": "^2.13.1|^3.0",
"doctrine/orm": "^2.12",
"dragonmantank/cron-expression": "^3",
"dragonmantank/cron-expression": "^3.1",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sync up with src/Symfony/Component/Scheduler/composer.json, lowest deps fail otherwise.

Copy link
Member

@kbond kbond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @HypeMC, this makes sense to me.

@fabpot
Copy link
Member

fabpot commented Jul 29, 2023

Thank you @HypeMC.

@fabpot fabpot merged commit e9413c7 into symfony:6.3 Jul 29, 2023
@HypeMC HypeMC deleted the postpone-schedule-creation branch July 29, 2023 18:10
@fabpot fabpot mentioned this pull request Jul 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants