r78787 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78786‎ | r78787 | r78788 >
Date:14:26, 22 December 2010
Author:catrope
Status:ok
Tags:
Comment:
Make Special:FundraiserStatistics cache timeout configurable and set it to 5 minutes by default (as opposed to 1 minute now)
Modified paths:
  • /trunk/extensions/ContributionReporting/ContributionReporting.php (modified) (history)
  • /trunk/extensions/ContributionReporting/FundraiserStatistics_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ContributionReporting/ContributionReporting.php
@@ -96,8 +96,11 @@
9797 $egFundraiserStatisticsMinimum = 1;
9898 $egFundraiserStatisticsMaximum = 10000;
9999
 100+// Cache timeout for fundraiser statistics, in seconds
 101+$egFundraiserStatisticsCacheTimeout = 300; // 5 minutes
100102
101103
 104+
102105 $wgContributionTrackingStatisticsViewWeeks = 3;
103106
104107 $wgHooks['ParserFirstCallInit'][] = 'efContributionReportingSetup';
Index: trunk/extensions/ContributionReporting/FundraiserStatistics_body.php
@@ -217,7 +217,7 @@
218218 /* Private Functions */
219219
220220 private function query( $type, $start, $end ) {
221 - global $wgMemc, $egFundraiserStatisticsMinimum, $egFundraiserStatisticsMaximum;
 221+ global $wgMemc, $egFundraiserStatisticsMinimum, $egFundraiserStatisticsMaximum, $egFundraiserStatisticsCacheTimeout;
222222
223223 $key = wfMemcKey( 'fundraiserstatistics', $type, $start, $end );
224224 $cache = $wgMemc->get( $key );
@@ -309,8 +309,7 @@
310310 break;
311311 }
312312 if ( isset( $result ) ) {
313 - // Cache invalidates once per minute
314 - $wgMemc->set( $key, $result, 60 );
 313+ $wgMemc->set( $key, $result, $egFundraiserStatisticsCacheTimeout );
315314 return $result;
316315 }
317316 return null;

Follow-up revisions

RevisionCommit summaryAuthorDate
r787991.16wmf4: MFT r78787catrope15:47, 22 December 2010
r797191.17: MFT r78078, r78285, r78787, r79246, r79358, r79480, r79481, r79491, r79...catrope14:15, 6 January 2011

Status & tagging log