From 93d3373edca42d2e954367d2a4a916a11dbf4b10 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 15 May 2015 16:00:00 -0700 Subject: [PATCH] Reduced the rate of RecentChangesUpdateJob insertion Change-Id: Ic7db658f45365ca8ddf7f9dc807a30bc707fe517 --- includes/page/WikiPage.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index 7b33b02e71..2098bec093 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -2206,12 +2206,14 @@ class WikiPage implements Page, IDBAccessObject { Hooks::run( 'ArticleEditUpdates', array( &$this, &$editInfo, $options['changed'] ) ); if ( Hooks::run( 'ArticleEditUpdatesDeleteFromRecentchanges', array( &$this ) ) ) { - JobQueueGroup::singleton()->push( array( - // Flush old entries from the `recentchanges` table - RecentChangesUpdateJob::newPurgeJob(), - // Update the cached list of active users - RecentChangesUpdateJob::newCacheUpdateJob() - ) ); + // Update the cached list of active users + $jobs = array( RecentChangesUpdateJob::newCacheUpdateJob() ); + // Flush old entries from the `recentchanges` table + if ( mt_rand( 0, 9 ) == 0 ) { + $jobs[] = RecentChangesUpdateJob::newPurgeJob(); + } + + JobQueueGroup::singleton()->push( $jobs ); } if ( !$this->exists() ) { -- 2.20.1