From: Aaron Schulz Date: Sat, 7 May 2016 01:49:44 +0000 (-0700) Subject: Make recent changes update jobs use configurable $wgUpdateRowsPerQuery X-Git-Tag: 1.31.0-rc.0~7036^2 X-Git-Url: http://git.cyclocoop.org/%22.%28%24lien.?a=commitdiff_plain;h=a1e0d9058f134cd8312c6f2ba201a094a6278dc0;p=lhc%2Fweb%2Fwiklou.git Make recent changes update jobs use configurable $wgUpdateRowsPerQuery Change-Id: I05d64ccefda79f46cd792c57f9617a13e5d84973 --- diff --git a/includes/jobqueue/jobs/RecentChangesUpdateJob.php b/includes/jobqueue/jobs/RecentChangesUpdateJob.php index 22afead165..fbc1572512 100644 --- a/includes/jobqueue/jobs/RecentChangesUpdateJob.php +++ b/includes/jobqueue/jobs/RecentChangesUpdateJob.php @@ -70,7 +70,7 @@ class RecentChangesUpdateJob extends Job { } protected function purgeExpiredRows() { - global $wgRCMaxAge; + global $wgRCMaxAge, $wgUpdateRowsPerQuery; $lockKey = wfWikiID() . ':recentchanges-prune'; @@ -81,14 +81,13 @@ class RecentChangesUpdateJob extends Job { return; // already in progress } - $batchSize = 100; // avoid slave lag $cutoff = $dbw->timestamp( time() - $wgRCMaxAge ); do { $rcIds = $dbw->selectFieldValues( 'recentchanges', 'rc_id', [ 'rc_timestamp < ' . $dbw->addQuotes( $cutoff ) ], __METHOD__, - [ 'LIMIT' => $batchSize ] + [ 'LIMIT' => $wgUpdateRowsPerQuery ] ); if ( $rcIds ) { $dbw->delete( 'recentchanges', [ 'rc_id' => $rcIds ], __METHOD__ ); @@ -96,7 +95,7 @@ class RecentChangesUpdateJob extends Job { // Commit in chunks to avoid slave lag $dbw->commit( __METHOD__, 'flush' ); - if ( count( $rcIds ) === $batchSize ) { + if ( count( $rcIds ) === $wgUpdateRowsPerQuery ) { // There might be more, so try waiting for slaves try { wfGetLBFactory()->waitForReplication( [ 'timeout' => 3 ] );