From ef4886778ffa2fccb99e190f822c1191deafd16e Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Thu, 17 Sep 2009 19:39:34 +0000 Subject: [PATCH] API: Per CR comments on r56091, make the timeout for the API help cache configurable --- includes/DefaultSettings.php | 6 ++++++ includes/api/ApiMain.php | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 3997a1fef3..5367619d12 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -3880,6 +3880,12 @@ $wgAPIRequestLog = false; */ $wgAPICacheHelp = true; +/** + * Set the timeout for the API help text cache. Ignored if $wgAPICacheHelp + * is false. + */ +$wgAPICacheHelpTimeout = 60*60; + /** * Parser test suite files to be run by parserTests.php when no specific * filename is passed to it. diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index 63f90dab43..6867193d25 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -555,7 +555,7 @@ class ApiMain extends ApiBase { * Override the parent to generate help messages for all available modules. */ public function makeHelpMsg() { - global $wgMemc, $wgAPICacheHelp; + global $wgMemc, $wgAPICacheHelp, $wgAPICacheHelpTimeout; $this->mPrinter->setHelp(); // Get help text from cache if present $key = wfMemcKey( 'apihelp', $this->getModuleName(), @@ -568,7 +568,7 @@ class ApiMain extends ApiBase { } $retval = $this->reallyMakeHelpMsg(); if ( $wgAPICacheHelp ) - $wgMemc->set( $key, $retval, 60*60 ); + $wgMemc->set( $key, $retval, $wgAPICacheHelpTimeout ); return $retval; } -- 2.20.1