diff --git a/product/ERP5Type/CachePlugins/DistributedRamCache.py b/product/ERP5Type/CachePlugins/DistributedRamCache.py index 3e995f63bb1db0e12747a891904c766411b361de..c5a0805f1eda4a761465d89abf3a1563da0bd444 100644 --- a/product/ERP5Type/CachePlugins/DistributedRamCache.py +++ b/product/ERP5Type/CachePlugins/DistributedRamCache.py @@ -60,6 +60,7 @@ class DistributedRamCache(BaseCache): self._server_max_value_length = params.get('server_max_value_length', 1024*1024) self._debug_level = params.get('debug_level', 0) self._key_prefix = params.get('key_prefix', '') + self._cache_plugin_path = params.get('cache_plugin_path') BaseCache.__init__(self) def initCacheStorage(self): @@ -91,7 +92,8 @@ class DistributedRamCache(BaseCache): def checkAndFixCacheId(self, cache_id, scope): ## memcached doesn't support namespaces (cache scopes) so to "emmulate" ## such behaviour when constructing cache_id we add scope in front - cache_id = "%s%s.%s" % (self._key_prefix, scope, cache_id) + cache_id = "%s%s%s%s" % (self._key_prefix, self._cache_plugin_path, + scope, cache_id) if self._server_max_key_length != 0: ## memcached will fail to store cache_id longer than MEMCACHED_SERVER_MAX_KEY_LENGTH. return cache_id[:self._server_max_key_length] diff --git a/product/ERP5Type/Tool/CacheTool.py b/product/ERP5Type/Tool/CacheTool.py index 9a5463488014bc0a601791ad6626301b21aa9e5f..9fe0366fb907f416db6783b424e2c90f70f13a14 100644 --- a/product/ERP5Type/Tool/CacheTool.py +++ b/product/ERP5Type/Tool/CacheTool.py @@ -91,6 +91,8 @@ class CacheTool(BaseTool): 'server': server, 'server_max_key_length': memcached_plugin.getServerMaxKeyLength(), 'server_max_value_length': memcached_plugin.getServerMaxValueLength(), + 'cache_plugin_path': cp.getPath(), + 'key_prefix': getattr(self, 'erp5_site_global_id', '') } cache_obj = DistributedRamCache(init_dict) if cache_obj is not None: