Making WordPress.org


Ignore:
Timestamp:
11/20/2019 06:59:20 AM (5 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-translation-sync.php

    r8461 r9284  
    3030
    3131            // Make sure the cache doesn't exhaust memory
    32             global $wp_object_cache;
    33             if ( is_object( $wp_object_cache ) ) {
    34                 $wp_object_cache->cache = array();
    35                 $wp_object_cache->stats = array( 'add' => 0, 'get' => 0, 'get_multi' => 0, 'delete' => 0);
    36                 $wp_object_cache->group_ops = array();
    37             }
     32            Manager::clear_memory_heavy_variables();
    3833
    3934            $args['offset'] += $args['posts_per_page'];
Note: See TracChangeset for help on using the changeset viewer.