Merge "ApiComparePages: Don't error with no prev/next rev"
[lhc/web/wiklou.git] / includes / api / ApiRollback.php
index db57f7e..18aa6da 100644 (file)
@@ -56,9 +56,13 @@ class ApiRollback extends ApiBase {
                }
 
                // @TODO: remove this hack once rollback uses POST (T88044)
+               $fname = __METHOD__;
                $trxLimits = $this->getConfig()->get( 'TrxProfilerLimits' );
                $trxProfiler = Profiler::instance()->getTransactionProfiler();
-               $trxProfiler->setExpectations( $trxLimits['POST'], __METHOD__ );
+               $trxProfiler->redefineExpectations( $trxLimits['POST'], $fname );
+               DeferredUpdates::addCallableUpdate( function () use ( $trxProfiler, $trxLimits, $fname ) {
+                       $trxProfiler->redefineExpectations( $trxLimits['PostSend-POST'], $fname );
+               } );
 
                $retval = $pageObj->doRollback(
                        $this->getRbUser( $params ),