Merge "Add database replication delay handling to Echo"

This commit is contained in:
Demon 2012-11-21 12:56:28 +00:00 committed by Gerrit Code Review
commit 9d2637ec44

View file

@ -15,7 +15,19 @@ abstract class EchoDiscussionParser {
static function generateEventsForRevision( $revision ) {
$interpretation = self::getChangeInterpretationForRevision( $revision );
$createdEvents = false;
// use slave database if there is a previous revision
if ( $revision->getPrevious() ) {
$title = Title::newFromID( $revision->getPage() );
// use master database for new page
} else {
$title = Title::newFromID( $revision->getPage(), Title::GAID_FOR_UPDATE );
}
// not a valid title
if ( !$title ) {
return;
}
$userID = $revision->getUser();
$userName = $revision->getUserText();