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
Amer
erp5
Commits
8ad996fb
Commit
8ad996fb
authored
Dec 31, 2012
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop meaningless default values.
Simplifies code creating a new connection.
parent
6fce7ae3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
product/ERP5Type/Tool/MemcachedTool.py
product/ERP5Type/Tool/MemcachedTool.py
+9
-8
No files found.
product/ERP5Type/Tool/MemcachedTool.py
View file @
8ad996fb
...
...
@@ -72,9 +72,11 @@ if memcache is not None:
- prove that concurency handling in event queuing is not needed
- make picklable ?
"""
def
__init__
(
self
,
server_list
,
expiration_time
=
0
,
server_max_key_length
=
memcache
.
SERVER_MAX_KEY_LENGTH
,
server_max_value_length
=
memcache
.
SERVER_MAX_VALUE_LENGTH
,
):
def
__init__
(
self
,
server_list
=
(
'127.0.0.1:11211'
,),
expiration_time
=
0
,
server_max_key_length
=
MARKER
,
server_max_value_length
=
MARKER
):
"""
Initialise properties :
memcached_connection
...
...
@@ -103,12 +105,11 @@ if memcache is not None:
self
.
memcached_connection
.
disconnect_all
()
except
AttributeError
:
pass
init_dict
=
{}
if
self
.
server_max_key_length
is
not
MARKER
:
init_dict
[
'server_max_key_length'
]
=
self
.
server_max_key_length
if
self
.
server_max_value_length
is
not
MARKER
:
init_dict
[
'server_max_value_length'
]
=
self
.
server_max_value_length
self
.
memcached_connection
=
memcache
.
Client
(
self
.
server_list
,
**
init_dict
)
self
.
memcached_connection
=
memcache
.
Client
(
self
.
server_list
,
server_max_key_length
=
self
.
server_max_key_length
,
server_max_value_length
=
self
.
server_max_value_length
,
)
def
__del__
(
self
):
"""
...
...
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