X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FMaintenance.php;h=c97c6a35f44ef1d24229665948ff3c8422f46636;hb=35d9ad550f2f443455b3b76495d9cebfafdfaf37;hp=a8dbd5f28061e6a54ad72442efb51cda6605a9e2;hpb=5a8b2edfdffbc962bb80763084d5c8b27ff45318;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php index a8dbd5f280..c97c6a35f4 100644 --- a/maintenance/Maintenance.php +++ b/maintenance/Maintenance.php @@ -603,13 +603,19 @@ abstract class Maintenance { * Activate the profiler (assuming $wgProfiler is set) */ protected function activateProfiler() { - global $wgProfiler; + global $wgProfiler, $wgProfileLimit, $wgTrxProfilerLimits; $output = $this->getOption( 'profiler' ); - if ( $output && is_array( $wgProfiler ) && isset( $wgProfiler['class'] ) ) { + if ( !$output ) { + return; + } + + if ( is_array( $wgProfiler ) && isset( $wgProfiler['class'] ) ) { $class = $wgProfiler['class']; $profiler = new $class( - array( 'sampling' => 1, 'output' => $output ) + $wgProfiler + array( 'sampling' => 1, 'output' => array( $output ) ) + + $wgProfiler + + array( 'threshold' => $wgProfileLimit ) ); $profiler->setTemplated( true ); Profiler::replaceStubInstance( $profiler ); @@ -617,8 +623,7 @@ abstract class Maintenance { $trxProfiler = Profiler::instance()->getTransactionProfiler(); $trxProfiler->setLogger( LoggerFactory::getInstance( 'DBPerformance' ) ); - # Catch huge single updates that lead to slave lag - $trxProfiler->setExpectation( 'maxAffected', 1000, __METHOD__ ); + $trxProfiler->setExpectations( $wgTrxProfilerLimits['Maintenance'], __METHOD__ ); } /** @@ -1106,7 +1111,7 @@ abstract class Maintenance { */ private function lockSearchindex( $db ) { $write = array( 'searchindex' ); - $read = array( 'page', 'revision', 'text', 'interwiki', 'l10n_cache', 'user' ); + $read = array( 'page', 'revision', 'text', 'interwiki', 'l10n_cache', 'user', 'page_restrictions' ); $db->lockTables( $read, $write, __CLASS__ . '::' . __METHOD__ ); }