Ignore DBPerformance warnings for ?action=purge for users with "purge"
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 24 Mar 2016 21:30:12 +0000 (14:30 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 24 Mar 2016 21:30:12 +0000 (14:30 -0700)
Change-Id: Ib6d1c9a6885008a7e2233adb26b6234787e32670

includes/actions/PurgeAction.php

index 508bbe0..576533d 100644 (file)
@@ -66,6 +66,10 @@ class PurgeAction extends FormAction {
                }
 
                if ( $user->isAllowed( 'purge' ) ) {
+                       // This will update the database immediately, even on HTTP GET.
+                       // Lots of uses may exist for this feature, so just ignore warnings.
+                       Profiler::instance()->getTransactionProfiler()->resetExpectations();
+
                        $this->redirectParams = wfArrayToCgi( array_diff_key(
                                $this->getRequest()->getQueryValues(),
                                [ 'title' => null, 'action' => null ]