list( $host, $lag ) = $lb->getMaxLag();
if ( $lag > $maxLag ) {
if ( $abort ) {
- header( 'HTTP/1.1 503 Service Unavailable' );
- header( 'Retry-After: ' . max( intval( $maxLag ), 5 ) );
- header( 'X-Database-Lag: ' . intval( $lag ) );
- header( 'Content-Type: text/plain' );
+ $resp = $this->context->getRequest()->response();
+ $resp->header( 'HTTP/1.1 503 Service Unavailable' );
+ $resp->header( 'Retry-After: ' . max( intval( $maxLag ), 5 ) );
+ $resp->header( 'X-Database-Lag: ' . intval( $lag ) );
+ $resp->header( 'Content-Type: text/plain' );
if( $wgShowHostnames ) {
echo "Waiting for $host: $lag seconds lagged\n";
} else {