X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fjobqueue%2Fjobs%2FRecentChangesUpdateJob.php;h=6f349d444703feb5b869509a7069f536e3c26cf8;hb=36395150104588f2afea866c330b683e4329fa48;hp=ca57d6234098796347d4c1571a9f026ade893def;hpb=925fe0df015458a330d320c9f1a0014d32ff8866;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/jobqueue/jobs/RecentChangesUpdateJob.php b/includes/jobqueue/jobs/RecentChangesUpdateJob.php index ca57d62340..6f349d4447 100644 --- a/includes/jobqueue/jobs/RecentChangesUpdateJob.php +++ b/includes/jobqueue/jobs/RecentChangesUpdateJob.php @@ -86,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(