r82759 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82758‎ | r82759 | r82760 >
Date:23:07, 24 February 2011
Author:aaron
Status:ok
Tags:
Comment:
Follow-up r82755: *sigh*...was testing the wrong code path, no wonder
Modified paths:
  • /trunk/extensions/ReaderFeedback/ReaderFeedback.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ReaderFeedback/ReaderFeedback.class.php
@@ -88,10 +88,10 @@
8989 */
9090 public static function getAverageRating( $article, $tag, $forUpdate=false ) {
9191 global $wgFeedbackAge;
 92+ $db = $forUpdate ? wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE );
9293 $cutoff_unixtime = time() - $wgFeedbackAge;
9394 // rfh_date is always MW format on all dbms
9495 $encCutoff = $db->addQuotes( wfTimestamp( TS_MW, $cutoff_unixtime ) );
95 - $db = $forUpdate ? wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE );
9696 $row = $db->selectRow( 'reader_feedback_history',
9797 array('SUM(rfh_total)/SUM(rfh_count) AS ave, SUM(rfh_count) AS count'),
9898 array( 'rfh_page_id' => $article->getId(), 'rfh_tag' => $tag,

Follow-up revisions

RevisionCommit summaryAuthorDate
r85033MFT more extension revs: r82601, r82654, r82698, r82755, r82756, r82759, r829...demon18:49, 30 March 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r82755Fixed timestamp use in getAverageRatingaaron23:04, 24 February 2011

Status & tagging log