From e79a6deea6194ed1379bcff66552616fcbd69f80 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 19 Nov 2018 11:56:49 -0800 Subject: [PATCH] Avoid post-send DBPerformance log warnings for page rollback Change-Id: I3d4eafc7d9d04647955822d5100d8cf253d80c8a --- includes/actions/RollbackAction.php | 3 +++ includes/api/ApiRollback.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/includes/actions/RollbackAction.php b/includes/actions/RollbackAction.php index c962e20d22..dec3e61535 100644 --- a/includes/actions/RollbackAction.php +++ b/includes/actions/RollbackAction.php @@ -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( diff --git a/includes/api/ApiRollback.php b/includes/api/ApiRollback.php index db57f7e034..10ba4782b7 100644 --- a/includes/api/ApiRollback.php +++ b/includes/api/ApiRollback.php @@ -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 ), -- 2.20.1