Repository navigation
fix: schedule the #[Schedule] methods of the application's own classes - #5
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A
#[Schedule]method in the application's own classes (app/) was never scheduled. Its discovery is applied while Laravel boots, before WordPress has loadedcron.php:CronIndex::read()called the undefined_get_cron_array(), theErrorwas caught byapply(), and the logger of the service is null, so nothing was placed and nothing was said. Classes of a theme, a plugin or a module are applied later and were not affected.Found on a throwaway project on the release head; the published framework v13.35.6 behaves the same (it called
wp_next_scheduled(), defined in the same file), so this is not a regression.When
did_action('init')is 0 the placement now waits forinit(priority 0, before any cron is spawned); later it is immediate, as before.Checked live (framework dev-release/v13.36.0): the event of a class in
app/is placed on the first boot and not placed again, from the CLI and from a web request, on WP-Cron; on the laravel driver it runs and queues its next occurrence about an hour later (with Pollora/framework#477).Test: applied before
init, nothing is scheduled until theinitcallbacks run. 107 tests, PHPStan, Pint. No tag: for the v1.0.0.