Switch away from wfGetDB()

Bug: T357657
Change-Id: I54f95397958c99b87083894cdf867d5ef6612fe7
This commit is contained in:
Amir Sarabadani 2024-03-18 21:34:56 +01:00
parent e986e0f83b
commit 055daa65ef
2 changed files with 2 additions and 2 deletions

View file

@ -191,7 +191,7 @@ class SpamBlacklist extends BaseBlacklist {
$cache->makeKey( 'external-link-list', $title->getLatestRevID() ),
$cache::TTL_MINUTE,
static function ( $oldValue, &$ttl, array &$setOpts ) use ( $title, $fname ) {
$dbr = wfGetDB( DB_REPLICA );
$dbr = MediaWikiServices::getInstance()->getConnectionProvider()->getReplicaDatabase();
$setOpts += Database::getCacheSetOptions( $dbr );
return ExternalLinksLookup::getExternalLinksForPage(
$title->getArticleID(),

View file

@ -50,7 +50,7 @@ class Cleanup extends Maintenance {
}
$dryRun = $this->hasOption( 'dry-run' );
$dbr = wfGetDB( DB_REPLICA );
$dbr = $this->getReplicaDB();
$maxID = (int)$dbr->selectField( 'page', 'MAX(page_id)', [], __METHOD__ );
$reportingInterval = 100;