Use DeferredUpdates::addCallableUpdate for generateEventsForRevision

* This diff part of this logic is fairly slow

Change-Id: Id9af5c18f852ba7f1c0d2b53257fe11cb87fc510
This commit is contained in:
Aaron Schulz 2015-05-18 12:58:15 -07:00
parent 6a6e92be57
commit 02f618d620

9
Hooks.php Normal file → Executable file
View file

@ -413,8 +413,14 @@ class EchoHooks {
public static function onArticleSaved( &$article, &$user, $text, $summary, $minoredit, $watchthis, $sectionanchor, &$flags, $revision, &$status ) {
global $wgEchoNotifications, $wgRequest;
if ( $revision ) {
if ( !$revision ) {
return true;
}
// Try to do this after the HTTP response
DeferredUpdates::addCallableUpdate( function() use ( $revision ) {
EchoDiscussionParser::generateEventsForRevision( $revision );
} );
// Handle the case of someone undoing an edit, either through the
// 'undo' link in the article history or via the API.
@ -442,7 +448,6 @@ class EchoHooks {
}
}
}
return true;
}