[Erp5-report] r13150 - /erp5/trunk/products/ERP5Type/Tool/CacheTool.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Mar 1 15:42:02 CET 2007


Author: ivan
Date: Thu Mar  1 15:41:37 2007
New Revision: 13150

URL: http://svn.erp5.org?rev=13150&view=rev
Log:
Added a method to clear all cache factories.

Modified:
    erp5/trunk/products/ERP5Type/Tool/CacheTool.py

Modified: erp5/trunk/products/ERP5Type/Tool/CacheTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Tool/CacheTool.py?rev=13150&r1=13149&r2=13150&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Tool/CacheTool.py (original)
+++ erp5/trunk/products/ERP5Type/Tool/CacheTool.py Thu Mar  1 15:41:37 2007
@@ -173,10 +173,20 @@
         CachingMethod.factories[key] = CacheFactory(item['cache_plugins'], item['cache_params'])    
     if REQUEST is not None:
       self.REQUEST.RESPONSE.redirect('cache_tool_configure?manage_tabs_message=Cache updated.')
-    
+
+  security.declareProtected(Permissions.ModifyPortalContent, 'clearAllCache')
+  def clearAllCache(self, REQUEST=None):
+    """ Clear all cache factories. """
+    ram_cache_root = self.getRamCacheRoot()
+    for cf_key in ram_cache_root.keys():
+      for cp in ram_cache_root[cf_key].getCachePluginList():
+        cp.clearCache()
+    if REQUEST is not None:
+      self.REQUEST.RESPONSE.redirect('cache_tool_configure?manage_tabs_message=All cache factories cleared.')
+      
   security.declareProtected(Permissions.ModifyPortalContent, 'clearCache')
   def clearCache(self, cache_factory_list=(DEFAULT_CACHE_FACTORY,), REQUEST=None):
-    """ Clear cache factory. """
+    """ Clear specified or default cache factory. """
     ram_cache_root = self.getRamCacheRoot()
     for cf_key in cache_factory_list:
       if ram_cache_root.has_key(cf_key):	    




More information about the Erp5-report mailing list