From 5eff5310ba87cadefe21f9810dc4fb7c9f350c1f Mon Sep 17 00:00:00 2001 From: Panagiotis Moustafellos Date: Sat, 24 Aug 2013 17:23:47 +0300 Subject: [PATCH] Added timeoutms parameter in MemCache --- framework/yii/caching/MemCache.php | 2 +- framework/yii/caching/MemCacheServer.php | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/framework/yii/caching/MemCache.php b/framework/yii/caching/MemCache.php index 34c10d0..86a0b45 100644 --- a/framework/yii/caching/MemCache.php +++ b/framework/yii/caching/MemCache.php @@ -94,7 +94,7 @@ class MemCache extends Cache $cache->addServer($server->host, $server->port, $server->weight); } else { $cache->addServer($server->host, $server->port, $server->persistent, - $server->weight, $server->timeout, $server->retryInterval, $server->status); + $server->weight, $server->timeout, $server->retryInterval, $server->status, null, $server->timemoutms); } } } else { diff --git a/framework/yii/caching/MemCacheServer.php b/framework/yii/caching/MemCacheServer.php index dc0de08..257398d 100644 --- a/framework/yii/caching/MemCacheServer.php +++ b/framework/yii/caching/MemCacheServer.php @@ -37,7 +37,7 @@ class MemCacheServer extends \yii\base\Object /** * @var integer value in seconds which will be used for connecting to the server. This is used by memcache only. */ - public $timeout = 15; + public $timeout = 2; /** * @var integer how often a failed server will be retried (in seconds). This is used by memcache only. */ @@ -46,4 +46,9 @@ class MemCacheServer extends \yii\base\Object * @var boolean if the server should be flagged as online upon a failure. This is used by memcache only. */ public $status = true; + /** + * @var integer value in milliseconds which will be used for connecting to the server. Takes precedence over timeout + */ + public $timemoutms = 2000; + }