humanmade / Cavalcade

A better wp-cron. Horizontally scalable, works perfectly with multisite.
https://engineering.hmn.md/projects/cavalcade/
Other
512 stars 46 forks source link

Ensure blog is installed before creating tables. #82

Closed peterwilsoncc closed 4 years ago

peterwilsoncc commented 5 years ago

WP fires the plugins_loaded hook during the install process, causing the Cavalcade tables to be created before the options table exists.

Without an options table, Cavalcade is unable to store the version of the database it is using it ends up considering all sites to be using version 1 of the database schema.

This adds a check to ensure is_blog_installed() == true before adding the Cavalcade database tables. I'm not sure how this affects multisite so would value any feedback.

Fixes #73

joehoyle commented 4 years ago

Hmm @roborourke @rmccue did we just fix something similar to this? Seem to remember needing to patch cavalcade when WP_INSTALLING was set... something along those lines?

roborourke commented 4 years ago

The issue is more to do with the runner, it doesn’t really handle a pre installation state and generates errors or quits the service entirely

joehoyle commented 4 years ago

Ok thanks @roborourke, @rmccue can you review and merge accordingly?

rmccue commented 4 years ago

@peterwilsoncc can you update per above? (I can't commit to your fork :) )

peterwilsoncc commented 4 years ago

Requested changes committed along with updates from master.

peterwilsoncc commented 4 years ago

@roborourke @rmccue Bumped with master again to include the CI fix. Tests are now passing.

It'll need some confirmation that the changes to plugin.php and namespace.php don't screw anything but testing locally it looks good to me.

stuartshields commented 4 years ago

@roborourke Can you approve and merge this PR in for @peterwilsoncc

roborourke commented 4 years ago

@stuartshields yeah, been meaning to test it locally. I was hoping to get #91 in first because the bulk of the tests are actually skipped right now