Skip to content
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

When indexable creation is disabled, cleanups are being scheduled upon post creation #21404

Closed
leonidasmi opened this issue May 23, 2024 · 1 comment · Fixed by #21438
Closed
Assignees

Comments

@leonidasmi
Copy link
Contributor

leonidasmi commented May 23, 2024

If the Yoast\WP\SEO\should_index_indexables filter is enabled and returning false, or we're on a non-production site, we don't create indexables. This has a side-effect:

  • When we save a post, then a cleanup sequence is scheduled (meaning, all the indexable cleanups that we have for orphaned indexables, non-public indexables, etc.)
  • The cleanups, when triggered, will actually do nothing and unschedule themselves (because of that filter, or because we're on a non-production site), so it has minimal impact on the performance of the websites, but still it's a thing to be fixed, because we're scheduling cron jobs needlessly with every post creation/update. UPDATE: The cleanups actions actually do run their cleanup queries, so it's something with more severity than initially reported.
@leonidasmi leonidasmi changed the title When indexable creation is disabled, cleanups are being scheduled (and later unscheduled) upon post creation When indexable creation is disabled, cleanups are being scheduled upon post creation May 24, 2024
@thijsoo thijsoo self-assigned this Jun 11, 2024
@thijsoo
Copy link
Contributor

thijsoo commented Jun 11, 2024

The solution will be:

  • If the filter is enabled when the plugin is enabled the cleanup cron should not be scheduled at all (or other reasons to schedule this cleanup)
  • If the cleanup is already scheduled to be run and the filter is enabled in the meantime it should early abort when running the cleanups.

@thijsoo thijsoo removed their assignment Jun 13, 2024
@thijsoo thijsoo assigned thijsoo and unassigned thijsoo Jun 26, 2024
@igorschoester igorschoester self-assigned this Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants