Merge pull request #14948 from owncloud/prefix-memcache
Add version and path to cache prefix
This commit is contained in:
commit
6d5f52484e
|
@ -21,6 +21,9 @@ abstract class Cache implements \ArrayAccess, \OCP\ICache {
|
||||||
$this->prefix = $prefix;
|
$this->prefix = $prefix;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string Prefix used for caching purposes
|
||||||
|
*/
|
||||||
public function getPrefix() {
|
public function getPrefix() {
|
||||||
return $this->prefix;
|
return $this->prefix;
|
||||||
}
|
}
|
||||||
|
|
|
@ -157,8 +157,13 @@ class Server extends SimpleContainer implements IServerContainer {
|
||||||
});
|
});
|
||||||
$this->registerService('MemCacheFactory', function ($c) {
|
$this->registerService('MemCacheFactory', function ($c) {
|
||||||
$config = $c->getConfig();
|
$config = $c->getConfig();
|
||||||
|
$v = \OC_App::getAppVersions();
|
||||||
|
$v['core'] = implode('.', \OC_Util::getVersion());
|
||||||
|
$version = implode(',', $v);
|
||||||
$instanceId = \OC_Util::getInstanceId();
|
$instanceId = \OC_Util::getInstanceId();
|
||||||
return new \OC\Memcache\Factory($instanceId,
|
$path = \OC::$SERVERROOT;
|
||||||
|
$prefix = md5($instanceId.'-'.$version.'-'.$path);
|
||||||
|
return new \OC\Memcache\Factory($prefix,
|
||||||
$config->getSystemValue('memcache.local', null),
|
$config->getSystemValue('memcache.local', null),
|
||||||
$config->getSystemValue('memcache.distributed', null)
|
$config->getSystemValue('memcache.distributed', null)
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue