Commit 66b0ef76 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

a small optimisation.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23768 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 89a6082b
......@@ -85,9 +85,7 @@ class DistributedRamCache(BaseCache):
## such behaviour when constructing cache_id we add scope in front
cache_id = "%s.%s" %(scope, cache_id)
## memcached will fail to store cache_id longer than MEMCACHED_SERVER_MAX_KEY_LENGTH.
if len(cache_id) > MEMCACHED_SERVER_MAX_KEY_LENGTH:
cache_id = cache_id[:MEMCACHED_SERVER_MAX_KEY_LENGTH]
return cache_id
return cache_id[:MEMCACHED_SERVER_MAX_KEY_LENGTH]
def get(self, cache_id, scope, default=None):
cache_storage = self.getCacheStorage()
......
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