r41446 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41445‎ | r41446 | r41447 >
Date:20:11, 30 September 2008
Author:brion
Status:old
Tags:
Comment:
s/slave/master/ on writes -- this worked on my test box with only one DB connection :)
Modified paths:
  • /trunk/extensions/CodeReview/CodeRevision.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/CodeRevision.php
@@ -127,7 +127,7 @@
128128 }
129129
130130 function saveComment( $text, $review, $parent=null ) {
131 - $dbw = wfGetDB( DB_SLAVE );
 131+ $dbw = wfGetDB( DB_MASTER );
132132 $data = $this->commentData( $text, $review, $parent );
133133 $data['cc_id'] = $dbw->nextSequenceValue( 'code_comment_cc_id' );
134134 $dbw->insert( 'code_comment',
@@ -139,7 +139,7 @@
140140
141141 protected function commentData( $text, $review, $parent=null ) {
142142 global $wgUser;
143 - $dbw = wfGetDB( DB_SLAVE );
 143+ $dbw = wfGetDB( DB_MASTER );
144144 $ts = wfTimestamp( TS_MW );
145145 $sortkey = $this->threadedSortkey( $parent, $ts );
146146 return array(
@@ -158,7 +158,7 @@
159159 if( $parent ) {
160160 // We construct a threaded sort key by concatenating the timestamps
161161 // of all our parent comments
162 - $dbw = wfGetDB( DB_SLAVE );
 162+ $dbw = wfGetDB( DB_MASTER );
163163 $parentKey = $dbw->selectField( 'code_comment',
164164 'cc_sortkey',
165165 array( 'cc_id' => $parent ),

Status & tagging log