From: Aaron Schulz Date: Fri, 15 May 2015 23:00:00 +0000 (-0700) Subject: Reduced the rate of RecentChangesUpdateJob insertion X-Git-Tag: 1.31.0-rc.0~11382^2 X-Git-Url: http://git.cyclocoop.org/%22.htmlspecialchars%28%24url_syndic%29.%22?a=commitdiff_plain;h=93d3373edca42d2e954367d2a4a916a11dbf4b10;p=lhc%2Fweb%2Fwiklou.git Reduced the rate of RecentChangesUpdateJob insertion Change-Id: Ic7db658f45365ca8ddf7f9dc807a30bc707fe517 --- 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() ) {