Commit c0651b01 authored by Nicolas Dumazet's avatar Nicolas Dumazet

be more flexible when initializing the cache


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42822 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 32e379f0
......@@ -51,10 +51,13 @@ def initializePortalCachingProperties(self):
global is_cache_initialized
global is_cache_ready
if not is_cache_initialized:
portal_caches = getattr(self.getPortalObject(), 'portal_caches', None)
if portal_caches is None:
return
# we set is_cache_initialized right now to prevent infinite loops
is_cache_initialized = 1
## update cache structure from portal_caches
self.getPortalObject().portal_caches.updateCache()
portal_caches.updateCache()
# we mark the cache as ready after initialization, because initialization
# itself will cause cache misses that we want to ignore
is_cache_ready = 1
......
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