Index: trunk/phase3/includes/Wiki.php |
— | — | @@ -526,38 +526,28 @@ |
527 | 527 | /** |
528 | 528 | * Checks if the request should abort due to a lagged server, |
529 | 529 | * for given maxlag parameter. |
530 | | - * |
531 | | - * @param boolean $abort True if this class should abort the |
532 | | - * script execution. False to return the result as a boolean. |
533 | | - * @return boolean True if we passed the check, false if we surpass the maxlag |
534 | 530 | */ |
535 | | - private function checkMaxLag( $abort ) { |
| 531 | + private function checkMaxLag() { |
536 | 532 | global $wgShowHostnames; |
537 | 533 | |
538 | 534 | wfProfileIn( __METHOD__ ); |
539 | 535 | $maxLag = $this->context->getRequest()->getVal( 'maxlag' ); |
540 | 536 | if ( !is_null( $maxLag ) ) { |
541 | | - $lb = wfGetLB(); // foo()->bar() is not supported in PHP4 |
542 | | - list( $host, $lag ) = $lb->getMaxLag(); |
| 537 | + list( $host, $lag ) = wfGetLB()->getMaxLag(); |
543 | 538 | if ( $lag > $maxLag ) { |
544 | | - if ( $abort ) { |
545 | | - $resp = $this->context->getRequest()->response(); |
546 | | - $resp->header( 'HTTP/1.1 503 Service Unavailable' ); |
547 | | - $resp->header( 'Retry-After: ' . max( intval( $maxLag ), 5 ) ); |
548 | | - $resp->header( 'X-Database-Lag: ' . intval( $lag ) ); |
549 | | - $resp->header( 'Content-Type: text/plain' ); |
550 | | - if( $wgShowHostnames ) { |
551 | | - echo "Waiting for $host: $lag seconds lagged\n"; |
552 | | - } else { |
553 | | - echo "Waiting for a database server: $lag seconds lagged\n"; |
554 | | - } |
| 539 | + $resp = $this->context->getRequest()->response(); |
| 540 | + $resp->header( 'HTTP/1.1 503 Service Unavailable' ); |
| 541 | + $resp->header( 'Retry-After: ' . max( intval( $maxLag ), 5 ) ); |
| 542 | + $resp->header( 'X-Database-Lag: ' . intval( $lag ) ); |
| 543 | + $resp->header( 'Content-Type: text/plain' ); |
| 544 | + if( $wgShowHostnames ) { |
| 545 | + echo "Waiting for $host: $lag seconds lagged\n"; |
| 546 | + } else { |
| 547 | + echo "Waiting for a database server: $lag seconds lagged\n"; |
555 | 548 | } |
556 | 549 | |
557 | 550 | wfProfileOut( __METHOD__ ); |
558 | 551 | |
559 | | - if ( !$abort ) { |
560 | | - return false; |
561 | | - } |
562 | 552 | exit; |
563 | 553 | } |
564 | 554 | } |