Commit fd19105d authored by Sebastien Robin's avatar Sebastien Robin

make sure we do not try to retrieve a delete object in...

make sure we do not try to retrieve a delete object in playBackRecordedObjectList, this makes hot reindexing stable at least on a single machine

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13529 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0f606620
...@@ -328,6 +328,9 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -328,6 +328,9 @@ class ZCatalog(Folder, Persistent, Implicit):
result = catalog_object.readRecordedObjectList(catalog=catalog) result = catalog_object.readRecordedObjectList(catalog=catalog)
if len(result): if len(result):
for o in result: for o in result:
if catalog==0:
self.uncatalog_object(uid=o.path, sql_catalog_id=sql_catalog_id)
elif catalog==1:
try: try:
obj = self.resolve_path(o.path) obj = self.resolve_path(o.path)
except ConflictError: except ConflictError:
...@@ -335,9 +338,6 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -335,9 +338,6 @@ class ZCatalog(Folder, Persistent, Implicit):
except: except:
obj = None obj = None
if obj is not None: if obj is not None:
if catalog == 0:
self.uncatalog_object(o.path, sql_catalog_id=sql_catalog_id)
elif catalog == 1:
obj.reindexObject(sql_catalog_id=sql_catalog_id) obj.reindexObject(sql_catalog_id=sql_catalog_id)
else: else:
raise ValueError, '%s is not a valid value for "catalog".' % (catalog, ) raise ValueError, '%s is not a valid value for "catalog".' % (catalog, )
......
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