Aude has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/330372 )

Change subject: Avoid master db connection on special page GET requests
......................................................................

Avoid master db connection on special page GET requests

Don't think slave lag is so much a problem on these
pages, and using a slave connection is okay here.

Bug: T154555
Change-Id: I7016af403e01e90f60c58b2f69691db8a5f3720c
---
M repo/includes/Specials/SpecialModifyEntity.php
1 file changed, 7 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/72/330372/1

diff --git a/repo/includes/Specials/SpecialModifyEntity.php 
b/repo/includes/Specials/SpecialModifyEntity.php
index aa5acb2..0842f2b 100644
--- a/repo/includes/Specials/SpecialModifyEntity.php
+++ b/repo/includes/Specials/SpecialModifyEntity.php
@@ -173,11 +173,11 @@
                }
 
                $entityId = $this->parseEntityId( $idString );
-               $this->entityRevision = $this->loadEntity( $entityId );
+               $this->entityRevision = $this->loadEntityRevision( $entityId );
        }
 
        /**
-        * Loads the entity for this entity id.
+        * Loads the latest EntityRevision for this entity id.
         *
         * @since 0.5
         *
@@ -187,12 +187,12 @@
         * @throws UserInputException
         * @return EntityRevision
         */
-       protected function loadEntity( EntityId $id ) {
+       protected function loadEntityRevision( EntityId $id ) {
                try {
-                       $entity = $this->entityRevisionLookup
-                               ->getEntityRevision( $id, 0, 
EntityRevisionLookup::LATEST_FROM_MASTER );
+                       $entityRevision = $this->entityRevisionLookup
+                               ->getEntityRevision( $id, 0, 
EntityRevisionLookup::LATEST_FROM_SLAVE );
 
-                       if ( $entity === null ) {
+                       if ( $entityRevision === null ) {
                                throw new UserInputException(
                                        'wikibase-wikibaserepopage-invalid-id',
                                        array( $id->getSerialization() ),
@@ -213,7 +213,7 @@
                        );
                }
 
-               return $entity;
+               return $entityRevision;
        }
 
        /**

-- 
To view, visit https://gerrit.wikimedia.org/r/330372
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7016af403e01e90f60c58b2f69691db8a5f3720c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Aude <aude.w...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to