Commit 4f7ce7f7 authored by Jean-Paul Smets's avatar Jean-Paul Smets

Added comment to explain why / how cache should be ideally cleared.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17614 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cd26080d
......@@ -66,7 +66,15 @@ class Preference( Folder ):
def _clearCache(self):
"""Clear caches used by methods of this preference
# TODO: clear different caches according to the preference priority
# TODO: (XXX) currently, if one use enables / disables a cache, caches
for all other users are reset. This is not good for a system
in which users do a lot of preference validation. A better solution
is needed for this. But it is not easy because the concept of
"per user cache" has been proven to be ambiguous or useless.
In theory, a solution could consist in using more keys to
select caches or to delete "manually" certain cache keys.
"""
portal_caches = getToolByName(self.getPortalObject(), 'portal_caches')
portal_caches.clearCache(cache_factory_list=('erp5_ui_short',))
......@@ -83,4 +91,3 @@ class Preference( Folder ):
def disable(self):
"""Workflow method"""
self._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