From 595a61d27b749b2ab82324f7cbe018a0bee016ae Mon Sep 17 00:00:00 2001 From: OverlordQ Date: Thu, 21 Jan 2010 05:49:49 +0000 Subject: [PATCH] Added configuration option for memcached timeout based on comments on r58185 --- RELEASE-NOTES | 3 ++- includes/DefaultSettings.php | 1 + includes/memcached-client.php | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index af2f180cba..0efac69bc0 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -94,7 +94,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Added $wgAdvertisedFeedTypes to decide what feed types (RSS, Atom, both, or neither) MediaWiki advertises. Default is array( 'atom' ), so RSS is no longer advertised by default (but it still works). - +* Added $wgMemCachedTimeout to configure connection timeouts for communicating + with a memcached server === New features in 1.16 === diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 5f9e8982dc..450d69bf40 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -793,6 +793,7 @@ $wgUseMemCached = false; $wgMemCachedDebug = false; ///< Will be set to false in Setup.php, if the server isn't working $wgMemCachedServers = array( '127.0.0.1:11000' ); $wgMemCachedPersistent = false; +$wgMemCachedTimeout = 100000; //Server connection timeout in microseconds /**@}*/ /** diff --git a/includes/memcached-client.php b/includes/memcached-client.php index ea65846d84..3b0ae90d5b 100644 --- a/includes/memcached-client.php +++ b/includes/memcached-client.php @@ -244,6 +244,7 @@ class MWMemcached { * @return mixed */ public function __construct( $args ) { + global $wgMemCachedTimeout; $this->set_servers( @$args['servers'] ); $this->_debug = @$args['debug']; $this->stats = array(); @@ -256,7 +257,7 @@ class MWMemcached { $this->_host_dead = array(); $this->_timeout_seconds = 0; - $this->_timeout_microseconds = 50000; + $this->_timeout_microseconds = $wgMemCachedTimeout; $this->_connect_timeout = 0.01; $this->_connect_attempts = 2; -- 2.20.1