From: Aaron Schulz Date: Thu, 28 Sep 2017 10:05:03 +0000 (+0200) Subject: Distinguish GET from POST for PostSend expectations X-Git-Tag: 1.31.0-rc.0~1937^2 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=aafaea29f3b3f0a31f720d3bec1d506aa8a82cc1;p=lhc%2Fweb%2Fwiklou.git Distinguish GET from POST for PostSend expectations This avoids needless log entries for POST requests. Bug: T166199 Change-Id: I515fde1f619f7f016d08b7c270a1c155ee171bf9 --- diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index d462228ed2..780976a1c8 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -6146,8 +6146,8 @@ $wgTrxProfilerLimits = [ 'writes' => 0, 'readQueryTime' => 5 ], - // Deferred updates that run after HTTP response is sent - 'PostSend' => [ + // Deferred updates that run after HTTP response is sent for GET requests + 'PostSend-GET' => [ 'readQueryTime' => 5, 'writeQueryTime' => 1, 'maxAffected' => 1000, @@ -6155,6 +6155,12 @@ $wgTrxProfilerLimits = [ 'masterConns' => 0, 'writes' => 0, ], + // Deferred updates that run after HTTP response is sent for POST requests + 'PostSend-POST' => [ + 'readQueryTime' => 5, + 'writeQueryTime' => 1, + 'maxAffected' => 1000 + ], // Background job runner 'JobRunner' => [ 'readQueryTime' => 30, diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php index 0f40c19201..43de4ba375 100644 --- a/includes/MediaWiki.php +++ b/includes/MediaWiki.php @@ -884,7 +884,9 @@ class MediaWiki { $trxProfiler = Profiler::instance()->getTransactionProfiler(); $trxProfiler->resetExpectations(); $trxProfiler->setExpectations( - $this->config->get( 'TrxProfilerLimits' )['PostSend'], + $this->context->getRequest()->hasSafeMethod() + ? $this->config->get( 'TrxProfilerLimits' )['PostSend-GET'] + : $this->config->get( 'TrxProfilerLimits' )['PostSend-POST'], __METHOD__ );