Avoid post-send DBPerformance log warnings for page rollback
authorAaron Schulz <aschulz@wikimedia.org>
Mon, 19 Nov 2018 19:56:49 +0000 (11:56 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 22 Nov 2018 19:42:03 +0000 (19:42 +0000)
Change-Id: I3d4eafc7d9d04647955822d5100d8cf253d80c8a

includes/actions/RollbackAction.php
includes/api/ApiRollback.php

index c962e20..dec3e61 100644 (file)
@@ -73,6 +73,9 @@ class RollbackAction extends FormlessAction {
                $trxLimits = $this->context->getConfig()->get( 'TrxProfilerLimits' );
                $trxProfiler = Profiler::instance()->getTransactionProfiler();
                $trxProfiler->setExpectations( $trxLimits['POST'], __METHOD__ );
+               DeferredUpdates::addCallableUpdate( function () use ( $trxProfiler, $trxLimits ) {
+                       $trxProfiler->setExpectations( $trxLimits['PostSend-POST'], __METHOD__ );
+               } );
 
                $data = null;
                $errors = $this->page->doRollback(
index db57f7e..10ba478 100644 (file)
@@ -59,6 +59,9 @@ class ApiRollback extends ApiBase {
                $trxLimits = $this->getConfig()->get( 'TrxProfilerLimits' );
                $trxProfiler = Profiler::instance()->getTransactionProfiler();
                $trxProfiler->setExpectations( $trxLimits['POST'], __METHOD__ );
+               DeferredUpdates::addCallableUpdate( function () use ( $trxProfiler, $trxLimits ) {
+                       $trxProfiler->setExpectations( $trxLimits['PostSend-POST'], __METHOD__ );
+               } );
 
                $retval = $pageObj->doRollback(
                        $this->getRbUser( $params ),