Commit d721c241 authored by Ivan Tyagov's avatar Ivan Tyagov

Setup volatile memcached cache factory.

parent 7b4a3d4c
...@@ -32,7 +32,7 @@ import unittest ...@@ -32,7 +32,7 @@ import unittest
from Testing import ZopeTestCase from Testing import ZopeTestCase
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.ERP5TypeTestCase import _getPersistentMemcachedServerDict from Products.ERP5Type.tests.ERP5TypeTestCase import _getPersistentMemcachedServerDict, _getVolatileMemcachedServerDict
from Products.ERP5Type.CachePlugins.DummyCache import DummyCache from Products.ERP5Type.CachePlugins.DummyCache import DummyCache
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
from Products.ERP5Type.Cache import CachingMethod from Products.ERP5Type.Cache import CachingMethod
...@@ -97,6 +97,12 @@ class TestCacheTool(ERP5TypeTestCase): ...@@ -97,6 +97,12 @@ class TestCacheTool(ERP5TypeTestCase):
def createPersistentMemcachedPlugin(self): def createPersistentMemcachedPlugin(self):
portal_memcached = self.getPortal().portal_memcached portal_memcached = self.getPortal().portal_memcached
connection_dict = _getVolatileMemcachedServerDict()
url_string = '%(hostname)s:%(port)s' % connection_dict
# setup default volatile distributed memcached
portal_memcached.default_memcached_plugin.setUrlString(url_string)
# setup persistent memcached
memcached_plugin_id = 'flare' memcached_plugin_id = 'flare'
if getattr(portal_memcached, memcached_plugin_id, None) is None: if getattr(portal_memcached, memcached_plugin_id, None) is None:
connection_dict = _getPersistentMemcachedServerDict() connection_dict = _getPersistentMemcachedServerDict()
......
Markdown is supported
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