Index: trunk/extensions/CodeReview/CodeReview.php |
— | — | @@ -168,6 +168,11 @@ |
169 | 169 | $wgCodeReviewUDPPort = false; |
170 | 170 | $wgCodeReviewUDPPrefix = ''; |
171 | 171 | |
| 172 | +/** |
| 173 | + * Length of time to cache repo stats for |
| 174 | + */ |
| 175 | +$wgCodeReviewRepoStatsCacheTime = 6 * 60 * 60; // 6 Hours |
| 176 | + |
172 | 177 | # Schema changes |
173 | 178 | $wgHooks['LoadExtensionSchemaUpdates'][] = 'efCodeReviewSchemaUpdates'; |
174 | 179 | |
Index: trunk/extensions/CodeReview/backend/RepoStats.php |
— | — | @@ -12,7 +12,7 @@ |
13 | 13 | $fixmes; |
14 | 14 | |
15 | 15 | public static function newFromRepo( CodeRepository $repo ) { |
16 | | - global $wgMemc; |
| 16 | + global $wgMemc, $wgCodeReviewRepoStatsCacheTime; |
17 | 17 | |
18 | 18 | $key = wfMemcKey( 'codereview1', 'stats', $repo->getName() ); |
19 | 19 | $stats = $wgMemc->get( $key ); |
— | — | @@ -24,7 +24,7 @@ |
25 | 25 | wfDebug( "miss\n" ); |
26 | 26 | $stats = new RepoStats( $repo ); |
27 | 27 | $stats->generate(); |
28 | | - $wgMemc->set( $key, $stats, 6 * 60 * 60 ); // 6 hours |
| 28 | + $wgMemc->set( $key, $stats, $wgCodeReviewRepoStatsCacheTime ); |
29 | 29 | return $stats; |
30 | 30 | } |
31 | 31 | |