From: Aaron Schulz Date: Sat, 3 Oct 2015 20:16:03 +0000 (-0700) Subject: Remove ?maxlag check in index.php X-Git-Tag: 1.31.0-rc.0~9547^2 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=beb385caf62309272a83a837932c409d9cac5361;p=lhc%2Fweb%2Fwiklou.git Remove ?maxlag check in index.php Any "good citizen" bots should be using the API anyway and less good bots will probably not bother sending the parameter Change-Id: I38f45b397d29b4709a932afc6319a1323e8d1200 --- diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php index f3fb15825f..e29319b594 100644 --- a/includes/MediaWiki.php +++ b/includes/MediaWiki.php @@ -471,7 +471,6 @@ class MediaWiki { */ public function run() { try { - $this->checkMaxLag(); try { $this->main(); } catch ( ErrorPageError $e ) { @@ -554,33 +553,6 @@ class MediaWiki { } } - /** - * Checks if the request should abort due to a lagged server, - * for given maxlag parameter. - * @return bool - */ - private function checkMaxLag() { - $maxLag = $this->context->getRequest()->getVal( 'maxlag' ); - if ( !is_null( $maxLag ) ) { - list( $host, $lag ) = wfGetLB()->getMaxLag(); - if ( $lag > $maxLag ) { - $resp = $this->context->getRequest()->response(); - $resp->statusHeader( 503 ); - $resp->header( 'Retry-After: ' . max( intval( $maxLag ), 5 ) ); - $resp->header( 'X-Database-Lag: ' . intval( $lag ) ); - $resp->header( 'Content-Type: text/plain' ); - if ( $this->config->get( 'ShowHostnames' ) ) { - echo "Waiting for $host: $lag seconds lagged\n"; - } else { - echo "Waiting for a database server: $lag seconds lagged\n"; - } - - exit; - } - } - return true; - } - private function main() { global $wgTitle, $wgTrxProfilerLimits;