Effectively remove EDIT_DEFER_UPDATES flag
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 8 Oct 2015 07:02:22 +0000 (00:02 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 8 Oct 2015 07:04:15 +0000 (00:04 -0700)
* All DeferrableUpdates will be deferred as normal.
  In CLI mode this is just post-commit and would have
  happened before the doUpdates() call anyway. For web
  requests this will be at request-end (post-send on HHVM).
  Note that deferral was already the default for EditPage.
* Previously, it was easy to accidently not set EDIT_DEFER_UPDATES.
  Deferred updates are supposed to be deferrable by definition,
  and there is no longer the problem of them piling up in CLI in
  recent versions. Not deferring mostly just forfeits performance.
* Also, it is not really the responsibility of WikiPage to be
  running DeferrableUpdate instances itself.

Change-Id: I2bc47b82635e0a24b1df5d502ba66f6de737697e

includes/EditPage.php
includes/page/WikiPage.php

index dac482c..23a7de4 100644 (file)
@@ -1942,7 +1942,7 @@ class EditPage {
                        return $status;
                }
 
-               $flags = EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY |
+               $flags = EDIT_AUTOSUMMARY |
                        ( $new ? EDIT_NEW : EDIT_UPDATE ) |
                        ( ( $this->minoredit && !$this->isNew ) ? EDIT_MINOR : 0 ) |
                        ( $bot ? EDIT_FORCE_BOT : 0 );
index e47e06c..3a77c94 100644 (file)
@@ -1588,8 +1588,6 @@ class WikiPage implements Page, IDBAccessObject {
         *          Do not log the change in recentchanges
         *      EDIT_FORCE_BOT
         *          Mark the edit a "bot" edit regardless of user rights
-        *      EDIT_DEFER_UPDATES
-        *          Defer some of the updates until the end of index.php
         *      EDIT_AUTOSUMMARY
         *          Fill in blank summaries with generated text where possible
         *
@@ -1650,8 +1648,6 @@ class WikiPage implements Page, IDBAccessObject {
         *          Do not log the change in recentchanges
         *      EDIT_FORCE_BOT
         *          Mark the edit a "bot" edit regardless of user rights
-        *      EDIT_DEFER_UPDATES
-        *          Defer some of the updates until the end of index.php
         *      EDIT_AUTOSUMMARY
         *          Fill in blank summaries with generated text where possible
         *
@@ -1945,11 +1941,6 @@ class WikiPage implements Page, IDBAccessObject {
                        Hooks::run( 'PageContentInsertComplete', $hook_args );
                }
 
-               // Do updates right now unless deferral was requested
-               if ( !( $flags & EDIT_DEFER_UPDATES ) ) {
-                       DeferredUpdates::doUpdates();
-               }
-
                // Return the new revision (or null) to the caller
                $status->value['revision'] = $revision;