* @param Title $requestTitle The original title, before any redirects were applied
*/
private function performAction( Page $page, Title $requestTitle ) {
-
$request = $this->context->getRequest();
$output = $this->context->getOutput();
$title = $this->context->getTitle();
}
$act = $this->getAction();
-
$action = Action::factory( $act, $page, $this->context );
if ( $action instanceof Action ) {
+ // Narrow DB query expectations for this HTTP request
+ $trxLimits = $this->config->get( 'TrxProfilerLimits' );
+ $trxProfiler = Profiler::instance()->getTransactionProfiler();
+ if ( $request->wasPosted() && !$action->doesWrites() ) {
+ $trxProfiler->setExpectations( $trxLimits['POST-nonwrite'], __METHOD__ );
+ }
+
# Let CDN cache things if we can purge them.
if ( $this->config->get( 'UseSquid' ) &&
in_array(
$output->setStatusCode( 404 );
$output->showErrorPage( 'nosuchaction', 'nosuchactiontext' );
}
-
}
/**
}
private function main() {
- global $wgTitle, $wgTrxProfilerLimits;
+ global $wgTitle;
$request = $this->context->getRequest();
$action = $this->getAction();
$wgTitle = $title;
+ // Set DB query expectations for this HTTP request
+ $trxLimits = $this->config->get( 'TrxProfilerLimits' );
$trxProfiler = Profiler::instance()->getTransactionProfiler();
$trxProfiler->setLogger( LoggerFactory::getInstance( 'DBPerformance' ) );
-
if ( $request->wasPosted() ) {
- $trxProfiler->setExpectations( $wgTrxProfilerLimits['POST'], __METHOD__ );
+ $trxProfiler->setExpectations( $trxLimits['POST'], __METHOD__ );
} else {
- $trxProfiler->setExpectations( $wgTrxProfilerLimits['GET'], __METHOD__ );
+ $trxProfiler->setExpectations( $trxLimits['GET'], __METHOD__ );
}
// If the user has forceHTTPS set to true, or if the user