r104481 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104480‎ | r104481 | r104482 >
Date:20:37, 28 November 2011
Author:kaldari
Status:resolved (Comments)
Tags:
Comment:
small optimization to DailyTotal
Modified paths:
  • /trunk/extensions/ContributionReporting/DailyTotal_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ContributionReporting/DailyTotal_body.php
@@ -8,8 +8,8 @@
99
1010 class SpecialDailyTotal extends IncludableSpecialPage {
1111
12 - protected $sharedMaxAge = 300; // Cache for 5 minutes on the server side
13 - protected $maxAge = 300; // Cache for 5 minutes on the client side
 12+ protected $sharedMaxAge = 600; // Cache for 10 minutes on the server side
 13+ protected $maxAge = 600; // Cache for 10 minutes on the client side
1414
1515 /* Functions */
1616
@@ -102,10 +102,14 @@
103103 return $cache;
104104 }
105105
 106+ // We're only interested in donations from the past 2 days at most
 107+ $recentTime = time() - 60 * 60 * 48;
 108+
106109 // Use database
107110 $dbr = efContributionReportingConnection();
108111 #$dbr = wfGetDB( DB_MASTER );
109112 $conditions = array(
 113+ 'received > ' . $recentTime;
110114 'converted_amount >= ' . $egFundraiserStatisticsMinimum,
111115 'converted_amount <= ' . $egFundraiserStatisticsMaximum,
112116 "DATE_FORMAT(CONVERT_TZ(FROM_UNIXTIME(received),'+00:00','$timeZoneOffset'),'%Y-%m-%d') = '$start'"
@@ -116,10 +120,7 @@
117121 'sum(converted_amount)'
118122 ),
119123 $conditions,
120 - __METHOD__,
121 - array(
122 - 'ORDER BY' => 'received'
123 - )
 124+ __METHOD__
124125 );
125126 $row = $dbr->fetchRow( $select );
126127 $total = $row['sum(converted_amount)'];

Follow-up revisions

RevisionCommit summaryAuthorDate
r104515Followup r104481, fixed syntax errorjohnduhart00:08, 29 November 2011
r104586MFT r104062, r104247, r104248, r104362, r104370, r104372, r104424, r104425, r...awjrichards20:22, 29 November 2011

Comments

#Comment by Johnduhart (talk | contribs)   00:06, 29 November 2011
+			'received > ' . $recentTime;

Caused a lint failure http://integration.mediawiki.org/ci/job/MediaWiki-lint/53/console

Status & tagging log