Commit 41fa67b1 authored by Jérome Perrin's avatar Jérome Perrin

method_id= is not supported in clearCache, use...

method_id= is not supported in clearCache, use context.portal_caches.clearCacheFactory if you need to flush a given cache.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11127 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d2fdd47c
...@@ -241,20 +241,9 @@ def disableReadOnlyTransactionCache(context): ...@@ -241,20 +241,9 @@ def disableReadOnlyTransactionCache(context):
## TODO: Check if it make sense to keep them any more ## ## TODO: Check if it make sense to keep them any more ##
######################################################## ########################################################
def clearCache(method_id = None, scope = DEFAULT_CACHE_SCOPE): def clearCache():
""" """Clear the whole cache. """
Clear the cache.
If method_id is specified, it clears the cache only for this method,
otherwise, it clears the whole cache. Make sure to specify scope otherwise
default one will be used.
"""
if method_id is not None:
## clear cache factories and plugins for specified method_id
for cf_id, cf_obj in CachingMethod.factories.items():
for cp in cf_obj.getCachePluginList():
cp.delete(method_id, scope)
else:
## clear (flush) whole cache
for cf_obj in CachingMethod.factories.values(): for cf_obj in CachingMethod.factories.values():
for cp in cf_obj.getCachePluginList(): for cp in cf_obj.getCachePluginList():
cp.clearCache() cp.clearCache()
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