mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-30 18:45:07 +00:00
Use DeferredUpdates::addCallableUpdate for generateEventsForRevision
* This diff part of this logic is fairly slow Change-Id: Id9af5c18f852ba7f1c0d2b53257fe11cb87fc510
This commit is contained in:
parent
6a6e92be57
commit
02f618d620
9
Hooks.php
Normal file → Executable file
9
Hooks.php
Normal file → Executable 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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue