From 02d999ead64429628a72a98b88f330a4155c5e1e Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 8 Oct 2015 00:02:22 -0700 Subject: [PATCH] Effectively remove EDIT_DEFER_UPDATES flag * 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 | 2 +- includes/page/WikiPage.php | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index dac482cbc8..23a7de4825 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -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 ); diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index e47e06cb49..3a77c94fa2 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -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; -- 2.20.1