X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fjobqueue%2Fjobs%2FRecentChangesUpdateJob.php;h=6f349d444703feb5b869509a7069f536e3c26cf8;hb=36395150104588f2afea866c330b683e4329fa48;hp=eb367aff239c12d3b37e1503b5a300549bdb6f59;hpb=3cb14f56bdf3271769a5866f9dcaad56bf873aea;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/jobqueue/jobs/RecentChangesUpdateJob.php b/includes/jobqueue/jobs/RecentChangesUpdateJob.php index eb367aff23..6f349d4447 100644 --- a/includes/jobqueue/jobs/RecentChangesUpdateJob.php +++ b/includes/jobqueue/jobs/RecentChangesUpdateJob.php @@ -16,7 +16,6 @@ * http://www.gnu.org/copyleft/gpl.html * * @file - * @author Aaron Schulz * @ingroup JobQueue */ use MediaWiki\MediaWikiServices; @@ -87,14 +86,21 @@ class RecentChangesUpdateJob extends Job { $ticket = $factory->getEmptyTransactionTicket( __METHOD__ ); $cutoff = $dbw->timestamp( time() - $wgRCMaxAge ); do { - $rcIds = $dbw->selectFieldValues( 'recentchanges', - 'rc_id', + $rcIds = []; + $rows = []; + $res = $dbw->select( 'recentchanges', + RecentChange::selectFields(), [ 'rc_timestamp < ' . $dbw->addQuotes( $cutoff ) ], __METHOD__, [ 'LIMIT' => $wgUpdateRowsPerQuery ] ); + foreach ( $res as $row ) { + $rcIds[] = $row->rc_id; + $rows[] = $row; + } if ( $rcIds ) { $dbw->delete( 'recentchanges', [ 'rc_id' => $rcIds ], __METHOD__ ); + Hooks::run( 'RecentChangesPurgeRows', [ $rows ] ); // There might be more, so try waiting for replica DBs try { $factory->commitAndWaitForReplication(