r98910 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98909‎ | r98910 | r98911 >
Date:20:50, 4 October 2011
Author:awjrichards
Status:ok
Tags:
Comment:
MFT r95929
Modified paths:
  • /branches/wmf/1.18wmf1/extensions/CentralNotice/CentralNotice.db.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/extensions/CentralNotice/CentralNotice.db.php
@@ -243,14 +243,20 @@
244244 /**
245245 * Return settings for a banner
246246 * @param $bannerName string name of banner
 247+ * @param $logging boolean whether or not request is for logging (optional)
247248 * @return an array of banner settings
248249 */
249 - static function getBannerSettings( $bannerName ) {
 250+ static function getBannerSettings( $bannerName, $logging = false ) {
250251 global $wgCentralDBname;
251252
252253 $banner = array();
253254
254 - $dbr = wfGetDB( DB_SLAVE, array(), $wgCentralDBname );
 255+ // If logging, read from the master database to avoid concurrency problems
 256+ if ( $logging ) {
 257+ $dbr = wfGetDB( DB_MASTER, array(), $wgCentralDBname );
 258+ } else {
 259+ $dbr = wfGetDB( DB_SLAVE, array(), $wgCentralDBname );
 260+ }
255261
256262 $row = $dbr->selectRow( 'cn_templates',
257263 array(
Property changes on: branches/wmf/1.18wmf1/extensions/CentralNotice/CentralNotice.db.php
___________________________________________________________________
Modified: svn:mergeinfo
258264 Merged /trunk/extensions/CentralNotice/CentralNotice.db.php:r95929

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r95929fix for a concurrency issue when loggingkaldari01:32, 1 September 2011

Status & tagging log