humanmade / Cavalcade

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

Ensure WP Options table exists before boostrapping/creating tables. #79

Closed peterwilsoncc closed 5 years ago

peterwilsoncc commented 5 years ago

The Cavalcade tables can be created prior to WP Core tables.

A couple of times I have seen the Cavalcade tables created in the database before the options table exists. Since Cavalcade started storing it's own DB version in the options table, this can now cause problems.

Prior to bootstrapping, a check to ensure the options table is created and populated will prevent this. For example:

if ( ! get_option( 'db_version' ) ) {
  return;
}
peterwilsoncc commented 5 years ago

I'm not sure what's going on here, I've seen the cavalcade database version fail to be stored on a server running:

In the instances I looked at the cavalcade tables were being created prior to the WP tables so Cavalcade's Schedule column was created but the plugin was unable to store the DB version.

wp-cavalcade-jobs-no-db-version

It means somehow the plugin file is being included and plugins_loaded firing despite is_blog_installed() === false.

peterwilsoncc commented 5 years ago

Closing, duplicate of #73