Commit 9d69f553 authored by Aurel's avatar Aurel

when uncataloging object, do not launch activity for each catalog,

instead remove in current catalog and launch for others


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17584 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 153fa167
...@@ -831,25 +831,29 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -831,25 +831,29 @@ class ZCatalog(Folder, Persistent, Implicit):
""" wrapper around catalog """ """ wrapper around catalog """
if uid is None: if uid is None:
raise TypeError, "sorry uncatalog_object supports only uid" raise TypeError, "sorry uncatalog_object supports only uid"
default_catalog = self.getSQLCatalog()
if sql_catalog_id is None:
archive_list = [] archive_list = []
if getattr(self, "portal_archives", None) is not None: if getattr(self, "portal_archives", None) is not None:
if len(self.portal_archives): if len(self.portal_archives):
archive_list = self.portal_archives.getArchiveList() archive_list = self.portal_archives.getArchiveList()
catalog_id = None if len(archive_list):
if len(archive_list) and sql_catalog_id is None:
for archive_path in archive_list: for archive_path in archive_list:
try: try:
archive = self.unrestrictedTraverse(archive_path) archive = self.unrestrictedTraverse(archive_path)
except KeyError: except KeyError:
continue continue
catalog_id = archive.getCatalogId() catalog_id = archive.getCatalogId()
if catalog_id != default_catalog.id:
# only launch activity when not in current catalog
self.activate(activity="SQLQueue", round_robin_scheduling=1, self.activate(activity="SQLQueue", round_robin_scheduling=1,
priority=archive.getPriority()).uncatalog_object(uid=uid,path=path, priority=archive.getPriority()).uncatalog_object(uid=uid,path=path,
sql_catalog_id=catalog_id) sql_catalog_id=catalog_id)
catalog = self.getSQLCatalog(sql_catalog_id) catalog = self.getSQLCatalog(sql_catalog_id)
if catalog is not None and catalog_id is None: if catalog is not None:
catalog.uncatalogObject(uid=uid,path=path) catalog.uncatalogObject(uid=uid,path=path)
if self.hot_reindexing_state is not None and self.source_sql_catalog_id == catalog.id: if self.hot_reindexing_state is not None and self.source_sql_catalog_id == catalog.id:
destination_catalog = self.getSQLCatalog(self.destination_sql_catalog_id) destination_catalog = self.getSQLCatalog(self.destination_sql_catalog_id)
......
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