summaryrefslogtreecommitdiff
path: root/it_cache.class
diff options
context:
space:
mode:
Diffstat (limited to 'it_cache.class')
-rw-r--r--it_cache.class4
1 files changed, 4 insertions, 0 deletions
diff --git a/it_cache.class b/it_cache.class
index cec55dd..22a9aa4 100644
--- a/it_cache.class
+++ b/it_cache.class
@@ -105,6 +105,10 @@ static function _get_memcache($p)
if (!isset($GLOBALS[$memcache_id]) && class_exists("Memcached", false))
{
$memcache = new Memcached;
+ $memcache->setOptions([
+ Memcached::OPT_CONNECT_TIMEOUT => 10,
+ Memcached::OPT_RETRY_TIMEOUT => 10,
+ ]);
foreach (array_filter(it::replace(array('[#\s].*' => ""), it::file($p['hostsfile']))) as $host)
$reachable += intval(@$memcache->addServer($host, 11211));