Making WordPress.org

Changeset 8461


Ignore:
Timestamp:
03/14/2019 04:55:02 AM (6 years ago)
Author:
tellyworth
Message:

Plugin directory: fix memory consumption issue in translation sync and re-enable cron job.

$wp_object_cache->group_ops was growing unbounded. Also cleaned up related PHP notices caused by undefined values in stats array.

Fixes #2977

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/jobs
Files:
2 edited

Legend:

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

    r7479 r8461  
    2222        add_action( 'plugin_directory_svn_sync', array( __NAMESPACE__ . '\SVN_Watcher', 'cron_trigger' ) );
    2323        add_action( 'plugin_directory_update_api_check', array( __NAMESPACE__ . '\API_Update_Updater', 'cron_trigger' ) );
     24        add_action( 'plugin_directory_translation_sync', array( __NAMESPACE__ . '\Translation_Sync', 'cron_trigger' ) );
    2425
    2526        // A cronjob to check cronjobs
     
    250251            wp_schedule_event( time() + 60, 'every_120s', 'plugin_directory_check_cronjobs' );
    251252        }
     253        if ( ! wp_next_scheduled ( 'plugin_directory_translation_sync' ) ) {
     254            wp_schedule_event( time() + 60, 'daily', 'plugin_directory_translation_sync' );
     255        }
    252256    }
    253257
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/jobs/class-translation-sync.php

    r7477 r8461  
    3333            if ( is_object( $wp_object_cache ) ) {
    3434                $wp_object_cache->cache = array();
    35                 $wp_object_cache->stats = array();
     35                $wp_object_cache->stats = array( 'add' => 0, 'get' => 0, 'get_multi' => 0, 'delete' => 0);
     36                $wp_object_cache->group_ops = array();
    3637            }
    3738
Note: See TracChangeset for help on using the changeset viewer.