r69272 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69271‎ | r69272 | r69273 >
Date:21:00, 11 July 2010
Author:aaron
Status:ok
Tags:
Comment:
Defer DB master connection
Modified paths:
  • /trunk/extensions/FlaggedRevs/FRDependencyUpdate.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FRDependencyUpdate.php
@@ -18,7 +18,6 @@
1919 $this->sTemplates = $stableOutput->getTemplates();
2020 $this->sImages = $stableOutput->getImages();
2121 $this->sCategories = $stableOutput->getCategories();
22 - $this->dbw = wfGetDB( DB_MASTER );
2322 }
2423
2524 public function doUpdate() {
@@ -62,13 +61,14 @@
6362 $existing = $this->getExistingDeps( FR_MASTER );
6463 $insertions = $this->getDepInsertions( $existing, $deps );
6564 $deletions = $this->getDepDeletions( $existing, $deps );
 65+ $dbw = wfGetDB( DB_MASTER );
6666 # Delete removed links
6767 if ( $deletions ) {
68 - $this->dbw->delete( 'flaggedrevs_tracking', $deletions, __METHOD__ );
 68+ $dbw->delete( 'flaggedrevs_tracking', $deletions, __METHOD__ );
6969 }
7070 # Add any new links
7171 if ( $insertions ) {
72 - $this->dbw->insert( 'flaggedrevs_tracking', $insertions, __METHOD__, 'IGNORE' );
 72+ $dbw->insert( 'flaggedrevs_tracking', $insertions, __METHOD__, 'IGNORE' );
7373 }
7474 }
7575 }
@@ -133,7 +133,7 @@
134134 }
135135 }
136136 if ( $del ) {
137 - $clause = self::makeWhereFrom2d( $del, $this->dbw );
 137+ $clause = self::makeWhereFrom2d( $del, wfGetDB( DB_MASTER ) );
138138 $where = array( $clause, 'ftr_from' => $this->title->getArticleId() );
139139 } else {
140140 $where = false;

Status & tagging log