Commit 8e0674d8 authored by Vincent Pelletier's avatar Vincent Pelletier

Simplify code.

Doc's mention about expiration time is precisely that server's code is
supposed to do just that internally.
parent 4889d523
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
# #
############################################################################## ##############################################################################
import time
from threading import local from threading import local
from Products.ERP5Type.Tool.BaseTool import BaseTool from Products.ERP5Type.Tool.BaseTool import BaseTool
from Products.ERP5Type import Permissions, _dtmldir from Products.ERP5Type import Permissions, _dtmldir
...@@ -96,8 +95,6 @@ if memcache is not None: ...@@ -96,8 +95,6 @@ if memcache is not None:
self.local_cache = {} self.local_cache = {}
self.scheduled_action_dict = {} self.scheduled_action_dict = {}
self.server_list = server_list self.server_list = server_list
# see "Expiration times" from memcached protocol docs
self.expiration_time_since_epoch = expiration_time > (60*60*24*30)
self.expiration_time = expiration_time self.expiration_time = expiration_time
self.server_max_key_length = server_max_key_length self.server_max_key_length = server_max_key_length
self.server_max_value_length = server_max_value_length self.server_max_value_length = server_max_value_length
...@@ -130,8 +127,6 @@ if memcache is not None: ...@@ -130,8 +127,6 @@ if memcache is not None:
""" """
try: try:
expiration_time = self.expiration_time expiration_time = self.expiration_time
if self.expiration_time_since_epoch:
expiration_time += time.time()
for key, value in self.local_cache.iteritems(): for key, value in self.local_cache.iteritems():
if getattr(value, MEMCACHED_TOOL_MODIFIED_FLAG_PROPERTY_ID, None): if getattr(value, MEMCACHED_TOOL_MODIFIED_FLAG_PROPERTY_ID, None):
delattr(value, MEMCACHED_TOOL_MODIFIED_FLAG_PROPERTY_ID) delattr(value, MEMCACHED_TOOL_MODIFIED_FLAG_PROPERTY_ID)
......
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