Commit 3944b842 authored by Victor Dubiniuk's avatar Victor Dubiniuk
Browse files

Set options, then add servers

parent 08da9a8a
......@@ -45,16 +45,6 @@ class Memcached extends Cache implements IMemcache {
parent::__construct($prefix);
if (is_null(self::$cache)) {
self::$cache = new \Memcached();
$servers = \OC::$server->getSystemConfig()->getValue('memcached_servers');
if (!$servers) {
$server = \OC::$server->getSystemConfig()->getValue('memcached_server');
if ($server) {
$servers = [$server];
} else {
$servers = [['localhost', 11211]];
}
}
self::$cache->addServers($servers);
$defaultOptions = [
\Memcached::OPT_CONNECT_TIMEOUT => 50,
......@@ -84,6 +74,17 @@ class Memcached extends Cache implements IMemcache {
} else {
throw new HintException("Expected 'memcached_options' config to be an array, got $options");
}
$servers = \OC::$server->getSystemConfig()->getValue('memcached_servers');
if (!$servers) {
$server = \OC::$server->getSystemConfig()->getValue('memcached_server');
if ($server) {
$servers = [$server];
} else {
$servers = [['localhost', 11211]];
}
}
self::$cache->addServers($servers);
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment