r77088 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77087‎ | r77088 | r77089 >
Date:22:20, 21 November 2010
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Variablise repo stats cache time to $wgCodeReviewRepoStatsCacheTime
Modified paths:
  • /trunk/extensions/CodeReview/CodeReview.php (modified) (history)
  • /trunk/extensions/CodeReview/backend/RepoStats.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/CodeReview.php
@@ -168,6 +168,11 @@
169169 $wgCodeReviewUDPPort = false;
170170 $wgCodeReviewUDPPrefix = '';
171171
 172+/**
 173+ * Length of time to cache repo stats for
 174+ */
 175+$wgCodeReviewRepoStatsCacheTime = 6 * 60 * 60; // 6 Hours
 176+
172177 # Schema changes
173178 $wgHooks['LoadExtensionSchemaUpdates'][] = 'efCodeReviewSchemaUpdates';
174179
Index: trunk/extensions/CodeReview/backend/RepoStats.php
@@ -12,7 +12,7 @@
1313 $fixmes;
1414
1515 public static function newFromRepo( CodeRepository $repo ) {
16 - global $wgMemc;
 16+ global $wgMemc, $wgCodeReviewRepoStatsCacheTime;
1717
1818 $key = wfMemcKey( 'codereview1', 'stats', $repo->getName() );
1919 $stats = $wgMemc->get( $key );
@@ -24,7 +24,7 @@
2525 wfDebug( "miss\n" );
2626 $stats = new RepoStats( $repo );
2727 $stats->generate();
28 - $wgMemc->set( $key, $stats, 6 * 60 * 60 ); // 6 hours
 28+ $wgMemc->set( $key, $stats, $wgCodeReviewRepoStatsCacheTime );
2929 return $stats;
3030 }
3131

Follow-up revisions

RevisionCommit summaryAuthorDate
r77102Followup r77088, better description per NikeRabbitreedy12:48, 22 November 2010
r801871.16wmf4: MFT r77088catrope20:04, 13 January 2011

Comments

#Comment by Nikerabbit (talk | contribs)   09:13, 22 November 2010

+ * Length of time to cache repo stats for Can we say that clearer and also explain what repo stats is?

#Comment by Reedy (talk | contribs)   09:43, 22 November 2010

Would the following be better?

* Length of time that Repository Statistics are cached for
* See [[Special:Code/reponame/stats]]
#Comment by Nikerabbit (talk | contribs)   09:57, 22 November 2010

How about?

* How long to cache repository statistics in seconds
* See http://www.mediawiki.org/wiki/Special:Code/MediaWiki/stats

PS: the link parsing is still broken.

#Comment by Reedy (talk | contribs)   11:19, 22 November 2010

Link parsing? My special link? I put in pre.. So it might've been bad

Not that it would work in function documentation ;)

Status & tagging log