jenkins-bot has submitted this change and it was merged.

Change subject: Use LoadBalancer::getConnectionRef()
......................................................................


Use LoadBalancer::getConnectionRef()

So we don't have to call reuseConnection() manually afterwards.

And use the newer DB_REPLICA.

Change-Id: Id095ea0ae749ed869a00206b1c8af431fc729dca
---
M GlobalUserPage.body.php
1 file changed, 1 insertion(+), 2 deletions(-)

Approvals:
  Tim Starling: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/GlobalUserPage.body.php b/GlobalUserPage.body.php
index 419a74c..32e38bf 100644
--- a/GlobalUserPage.body.php
+++ b/GlobalUserPage.body.php
@@ -167,7 +167,7 @@
 
                global $wgGlobalUserPageDBname;
                $lb = wfGetLB( $wgGlobalUserPageDBname );
-               $dbr = $lb->getConnection( DB_SLAVE, array(), 
$wgGlobalUserPageDBname );
+               $dbr = $lb->getConnectionRef( DB_REPLICA, array(), 
$wgGlobalUserPageDBname );
                $row = $dbr->selectRow(
                        [ 'page', 'page_props' ],
                        [ 'page_touched', 'pp_propname' ],
@@ -190,7 +190,6 @@
                } else {
                        $touched = false;
                }
-               $lb->reuseConnection( $dbr );
 
                self::$touchedCache->set( $user->getName(), $touched );
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id095ea0ae749ed869a00206b1c8af431fc729dca
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/GlobalUserPage
Gerrit-Branch: master
Gerrit-Owner: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: Alex Monk <a...@wikimedia.org>
Gerrit-Reviewer: Tim Starling <tstarl...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to