Introduce wp_using_ext_object_cache() - mimic wp_suspend_cache_invalidation() and discourage direct access to $_wp_using_ext_object_cache, cleaning up importing of globals in functions and provides function to modify that global. Loads the packaged object cache when an external cache hasn't been loaded or doesn't contain wp_cache_init().
Fixes #21401. Built from https://develop.svn.wordpress.org/trunk@25289 git-svn-id: http://core.svn.wordpress.org/trunk@25253 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -28,10 +28,10 @@ if ( !defined('ABSPATH') ) {
|
||||
|
||||
// Uncached doing_cron transient fetch
|
||||
function _get_cron_lock() {
|
||||
global $_wp_using_ext_object_cache, $wpdb;
|
||||
global $wpdb;
|
||||
|
||||
$value = 0;
|
||||
if ( $_wp_using_ext_object_cache ) {
|
||||
if ( wp_using_ext_object_cache() ) {
|
||||
// Skip local cache and force refetch of doing_cron transient in case
|
||||
// another processs updated the cache
|
||||
$value = wp_cache_get( 'doing_cron', 'transient', true );
|
||||
|
||||
Reference in New Issue
Block a user