Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ludovic Kiefer
erp5
Commits
d721c241
Commit
d721c241
authored
Oct 21, 2011
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Setup volatile memcached cache factory.
parent
7b4a3d4c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
product/ERP5Type/tests/testCacheTool.py
product/ERP5Type/tests/testCacheTool.py
+8
-2
No files found.
product/ERP5Type/tests/testCacheTool.py
View file @
d721c241
...
@@ -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,10 +97,16 @@ class TestCacheTool(ERP5TypeTestCase):
...
@@ -97,10 +97,16 @@ 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
()
url_string
=
'%(hostname)s:%(port)s'
%
connection_dict
url_string
=
'%(hostname)s:%(port)s'
%
connection_dict
portal_memcached
.
newContent
(
portal_type
=
'Memcached Plugin'
,
portal_memcached
.
newContent
(
portal_type
=
'Memcached Plugin'
,
id
=
memcached_plugin_id
,
id
=
memcached_plugin_id
,
url_string
=
url_string
,
url_string
=
url_string
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment