Browse Source

Added timeoutms parameter in MemCache

tags/2.0.0-beta
Panagiotis Moustafellos 11 years ago
parent
commit
5eff5310ba
  1. 2
      framework/yii/caching/MemCache.php
  2. 7
      framework/yii/caching/MemCacheServer.php

2
framework/yii/caching/MemCache.php

@ -94,7 +94,7 @@ class MemCache extends Cache
$cache->addServer($server->host, $server->port, $server->weight); $cache->addServer($server->host, $server->port, $server->weight);
} else { } else {
$cache->addServer($server->host, $server->port, $server->persistent, $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 { } else {

7
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. * @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. * @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. * @var boolean if the server should be flagged as online upon a failure. This is used by memcache only.
*/ */
public $status = true; public $status = true;
/**
* @var integer value in milliseconds which will be used for connecting to the server. Takes precedence over timeout
*/
public $timemoutms = 2000;
} }

Loading…
Cancel
Save