diff options
author | Amir Sarabadani <ladsgroup@gmail.com> | 2024-01-17 19:53:40 +0100 |
---|---|---|
committer | Amir Sarabadani <ladsgroup@gmail.com> | 2024-01-18 15:12:04 +0100 |
commit | d9370003fb801c22cc6ab9f09f15c26e11ca19cd (patch) | |
tree | ffe9fe826343d3aba15f321bffc4f9809f0a51cb /maintenance/addRFCandPMIDInterwiki.php | |
parent | 6d71df9dcb0fb043db9942819e2f5883cec97c0e (diff) | |
download | mediawikicore-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/addRFCandPMIDInterwiki.php')
-rw-r--r-- | maintenance/addRFCandPMIDInterwiki.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/maintenance/addRFCandPMIDInterwiki.php b/maintenance/addRFCandPMIDInterwiki.php index d64dcddb3474..698ec5cd6b28 100644 --- a/maintenance/addRFCandPMIDInterwiki.php +++ b/maintenance/addRFCandPMIDInterwiki.php @@ -50,7 +50,7 @@ class AddRFCandPMIDInterwiki extends LoggedUpdateMaintenance { if ( $interwikiCache !== false ) { return true; } - $dbw = $this->getDB( DB_PRIMARY ); + $dbw = $this->getPrimaryDB(); $rfc = $dbw->newSelectQueryBuilder() ->select( 'iw_url' ) |