Making WordPress.org


Ignore:
Timestamp:
11/20/2019 06:59:20 AM (4 years ago)
Author:
dd32
Message:

Plugin Directory: Cron Jobs: Clear the Memcache cache within WordPress after processing lots of posts to allow Jetpack Sync to have some memory free.

This avoids plenty of post-shutdown fatals in cron tasks WordPress.org is currently experiencing and consolidates such code to a single instance.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/jobs/class-plugin-support-resolved.php

    r6571 r9284  
    7070            }
    7171
    72             self::stop_the_insanity();
     72            Manager::clear_memory_heavy_variables();
    7373        }
    7474    }
    7575
    76     /**
    77      * Clear caches for memory management.
    78      *
    79      * @static
    80      * @global \wpdb            $wpdb
    81      * @global \WP_Object_Cache $wp_object_cache
    82      */
    83     protected static function stop_the_insanity() {
    84         global $wpdb, $wp_object_cache;
    85 
    86         $wpdb->queries = [];
    87 
    88         if ( is_object( $wp_object_cache ) ) {
    89             $wp_object_cache->cache          = [];
    90             $wp_object_cache->group_ops      = [];
    91             $wp_object_cache->memcache_debug = [];
    92             $wp_object_cache->stats          = [];
    93         }
    94     }
    9576}
Note: See TracChangeset for help on using the changeset viewer.