diff --git a/includes/SpamBlacklist.php b/includes/SpamBlacklist.php index 8792a199..8b637f76 100644 --- a/includes/SpamBlacklist.php +++ b/includes/SpamBlacklist.php @@ -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(), diff --git a/maintenance/cleanup.php b/maintenance/cleanup.php index 98822906..8ec92925 100644 --- a/maintenance/cleanup.php +++ b/maintenance/cleanup.php @@ -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;