r105494 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105493‎ | r105494 | r105495 >
Date:23:54, 7 December 2011
Author:awjrichards
Status:ok
Tags:
Comment:
Modified paths:
  • /branches/wmf/1.18wmf1/extensions/ContributionReporting (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/ContributionReporting/ContributionReporting.php (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/ContributionReporting/FundraiserStatistics_body.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/extensions/ContributionReporting/ContributionReporting.php
@@ -115,9 +115,12 @@
116116 $egFundraiserStatisticsMinimum = 1;
117117 $egFundraiserStatisticsMaximum = 10000;
118118
119 -// Cache timeout for fundraiser statistics, in seconds
 119+// Cache timeout for fundraiser statistics (short timeout), in seconds
120120 $egFundraiserStatisticsCacheTimeout = 900; // 15 minutes
 121+// Cache timeout for fundraiser statistics (long timeout), in seconds
 122+$wgFundraiserStatisticsLongCacheTimeout = 60 * 60 * 24 * 7; // one week
121123
 124+
122125 $wgContributionTrackingStatisticsViewWeeks = 3;
123126
124127 $commonModuleInfo = array(
Property changes on: branches/wmf/1.18wmf1/extensions/ContributionReporting/ContributionReporting.php
___________________________________________________________________
Modified: svn:mergeinfo
125128 Merged /trunk/extensions/ContributionReporting/ContributionReporting.php:r105492
Index: branches/wmf/1.18wmf1/extensions/ContributionReporting/FundraiserStatistics_body.php
@@ -312,7 +312,7 @@
313313 * @return an array of results or null
314314 */
315315 private function query( $mostRecent, $start, $end ) {
316 - global $wgMemc, $egFundraiserStatisticsMinimum, $egFundraiserStatisticsMaximum, $egFundraiserStatisticsCacheTimeout;
 316+ global $wgMemc, $egFundraiserStatisticsMinimum, $egFundraiserStatisticsMaximum, $egFundraiserStatisticsCacheTimeout, $wgFundraiserStatisticsLongCacheTimeout;
317317
318318 // Conctruct the key for memcached
319319 $key = wfMemcKey( 'fundraiserstatistics', $start, $end );
@@ -359,11 +359,11 @@
360360 if ( isset( $result ) ) {
361361 // Store the result in memcached.
362362 // If it's the most recent fundraiser, cache for a short period of time, otherwise
363 - // cache for 24 hours (since the query is expensive).
 363+ // cache for long period of time
364364 if ( $mostRecent ) {
365365 $wgMemc->set( $key, $result, $egFundraiserStatisticsCacheTimeout );
366366 } else {
367 - $wgMemc->set( $key, $result, 86400 );
 367+ $wgMemc->set( $key, $result, $wgFundraiserStatisticsLongCacheTimeout );
368368 }
369369 return $result;
370370 }
Property changes on: branches/wmf/1.18wmf1/extensions/ContributionReporting/FundraiserStatistics_body.php
___________________________________________________________________
Modified: svn:mergeinfo
371371 Merged /trunk/extensions/ContributionReporting/FundraiserStatistics_body.php:r105492
Property changes on: branches/wmf/1.18wmf1/extensions/ContributionReporting
___________________________________________________________________
Modified: svn:mergeinfo
372372 Merged /trunk/extensions/ContributionReporting:r105492

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r105492Making long cache time configurableawjrichards23:52, 7 December 2011

Status & tagging log