aboutsummaryrefslogtreecommitdiffstats
path: root/maintenance/cleanupBlocks.php
diff options
context:
space:
mode:
authorAmir Sarabadani <ladsgroup@gmail.com>2024-01-17 19:53:40 +0100
committerAmir Sarabadani <ladsgroup@gmail.com>2024-01-18 15:12:04 +0100
commitd9370003fb801c22cc6ab9f09f15c26e11ca19cd (patch)
treeffe9fe826343d3aba15f321bffc4f9809f0a51cb /maintenance/cleanupBlocks.php
parent6d71df9dcb0fb043db9942819e2f5883cec97c0e (diff)
downloadmediawikicore-d9370003fb801c22cc6ab9f09f15c26e11ca19cd.tar.gz
mediawikicore-d9370003fb801c22cc6ab9f09f15c26e11ca19cd.zip
maintenance: Introduce getReplicaDB() and getPrimaryDB()
And start using them instead of wfGetDB(), LB/LBF connection methods or worse, $this->getDB(). $this->getDB() reuses the database object regardless of whether you're calling a replica or primary, leading to returning a replica on a primary and other way around. Bug: T330641 Change-Id: I9e2cf85ca277022284fc26b9f37db57bd12aaa81
Diffstat (limited to 'maintenance/cleanupBlocks.php')
-rw-r--r--maintenance/cleanupBlocks.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/maintenance/cleanupBlocks.php b/maintenance/cleanupBlocks.php
index b524c919b9b4..22049e70683c 100644
--- a/maintenance/cleanupBlocks.php
+++ b/maintenance/cleanupBlocks.php
@@ -42,7 +42,7 @@ class CleanupBlocks extends Maintenance {
}
public function execute() {
- $db = $this->getDB( DB_PRIMARY );
+ $db = $this->getPrimaryDB();
$blockQuery = DatabaseBlock::getQueryInfo();
$max = $db->newSelectQueryBuilder()