X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2FSiteStats.php;h=cf3a1ebdf7adfbb60e59837af84174996bd0d037;hp=e3cb617e3fa97cb6d92a18e85acad220c3243cc8;hb=9c7f6734c397a954b8eaa5ec73876f2b4bf92afb;hpb=628fccb967b99ed7e84127da42f320274378b2e9 diff --git a/includes/SiteStats.php b/includes/SiteStats.php index e3cb617e3f..cf3a1ebdf7 100644 --- a/includes/SiteStats.php +++ b/includes/SiteStats.php @@ -52,14 +52,14 @@ class SiteStats { $config = MediaWikiServices::getInstance()->getMainConfig(); $lb = self::getLB(); - $dbr = $lb->getConnection( DB_REPLICA ); + $dbr = $lb->getConnectionRef( DB_REPLICA ); wfDebug( __METHOD__ . ": reading site_stats from replica DB\n" ); $row = self::doLoadFromDB( $dbr ); if ( !self::isRowSane( $row ) && $lb->hasOrMadeRecentMasterChanges() ) { // Might have just been initialized during this request? Underflow? wfDebug( __METHOD__ . ": site_stats damaged or missing on replica DB\n" ); - $row = self::doLoadFromDB( $lb->getConnection( DB_MASTER ) ); + $row = self::doLoadFromDB( $lb->getConnectionRef( DB_MASTER ) ); } if ( !self::isRowSane( $row ) ) { @@ -76,7 +76,7 @@ class SiteStats { SiteStatsInit::doAllAndCommit( $dbr ); } - $row = self::doLoadFromDB( $lb->getConnection( DB_MASTER ) ); + $row = self::doLoadFromDB( $lb->getConnectionRef( DB_MASTER ) ); } if ( !self::isRowSane( $row ) ) { @@ -155,7 +155,7 @@ class SiteStats { $cache->makeKey( 'SiteStats', 'groupcounts', $group ), $cache::TTL_HOUR, function ( $oldValue, &$ttl, array &$setOpts ) use ( $group, $fname ) { - $dbr = self::getLB()->getConnection( DB_REPLICA ); + $dbr = self::getLB()->getConnectionRef( DB_REPLICA ); $setOpts += Database::getCacheSetOptions( $dbr ); return (int)$dbr->selectField( @@ -206,7 +206,7 @@ class SiteStats { $cache->makeKey( 'SiteStats', 'page-in-namespace', $ns ), $cache::TTL_HOUR, function ( $oldValue, &$ttl, array &$setOpts ) use ( $ns, $fname ) { - $dbr = self::getLB()->getConnection( DB_REPLICA ); + $dbr = self::getLB()->getConnectionRef( DB_REPLICA ); $setOpts += Database::getCacheSetOptions( $dbr ); return (int)$dbr->selectField(