Commit e2ce9081 authored by Sebastien Robin's avatar Sebastien Robin

allow to disable the new cache made by yoshinori for inventories


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4805 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 39281bd5
......@@ -1038,7 +1038,8 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base):
expression_cache = {}
try:
enableTransactionCache(self)
if not disable_cache:
enableTransactionCache(self)
method_kw_dict = {}
for method_name in method_id_list:
......@@ -1125,7 +1126,8 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base):
error=sys.exc_info())
raise
finally:
disableTransactionCache(self)
if not disable_cache:
disableTransactionCache(self)
if psyco is not None: psyco.bind(catalogObjectList)
......
......@@ -607,7 +607,7 @@ class ZCatalog(Folder, Persistent, Implicit):
""" wrapper around catalog """
self.catalogObjectList([obj], sql_catalog_id=sql_catalog_id)
def catalogObjectList(self, object_list, sql_catalog_id=None):
def catalogObjectList(self, object_list, sql_catalog_id=None,**kw):
"""Catalog a list of objects.
"""
hot_reindexing = 0
......@@ -641,7 +641,7 @@ class ZCatalog(Folder, Persistent, Implicit):
catalog = self.getSQLCatalog(sql_catalog_id)
if catalog is not None:
catalog.catalogObjectList(wrapped_object_list)
catalog.catalogObjectList(wrapped_object_list,**kw)
if hot_reindexing:
destination_catalog = self.getSQLCatalog(self.destination_sql_catalog_id)
......@@ -649,7 +649,7 @@ class ZCatalog(Folder, Persistent, Implicit):
destination_catalog.recordCatalogObjectList(url_list)
else:
destination_catalog.deleteRecordedObjectList(url_list) # Prevent this object from being replayed.
destination_catalog.catalogObjectList(wrapped_object_list)
destination_catalog.catalogObjectList(wrapped_object_list,**kw)
object_list[:] = failed_object_list[:]
......
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