Index: branches/wmf/1.18wmf1/extensions/CentralNotice/CentralNotice.db.php |
— | — | @@ -243,14 +243,20 @@ |
244 | 244 | /** |
245 | 245 | * Return settings for a banner |
246 | 246 | * @param $bannerName string name of banner |
| 247 | + * @param $logging boolean whether or not request is for logging (optional) |
247 | 248 | * @return an array of banner settings |
248 | 249 | */ |
249 | | - static function getBannerSettings( $bannerName ) { |
| 250 | + static function getBannerSettings( $bannerName, $logging = false ) { |
250 | 251 | global $wgCentralDBname; |
251 | 252 | |
252 | 253 | $banner = array(); |
253 | 254 | |
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 | + } |
255 | 261 | |
256 | 262 | $row = $dbr->selectRow( 'cn_templates', |
257 | 263 | array( |
Property changes on: branches/wmf/1.18wmf1/extensions/CentralNotice/CentralNotice.db.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
258 | 264 | Merged /trunk/extensions/CentralNotice/CentralNotice.db.php:r95929 |