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

`$wpdb->get_results()` will never return false here, so we don't need to rely upon the `$found` flag that's not available in all object caches. #100

Closed dd32 closed 3 years ago

dd32 commented 4 years ago

$wpdb->get_results() will never return false here, so we don't need to rely upon the $found flag that's not available in all object caches.

This fixes job query caching when running on a persistent cache which doesn't implement the $found parameter or doesn't consider in-memory caches as "found" (see https://github.com/Automattic/wp-memcached/issues/61).

I noticed a duplicate job query when updating WordPress.org with the plugin, stemming from Jetpack calling both wp_next_scheduled() and wp_get_schedule().

Props @peterwilsoncc for confirming that $wpdb->get_results() always returns an array.

roborourke commented 3 years ago

Thanks @dd32 !

roborourke commented 3 years ago

Released in 2.0.1