Commit 42e0678a authored by Ayush Tiwari's avatar Ayush Tiwari

multiple_catalog: Test predicate on objects in object_list before catalogging

parent 12340e88
...@@ -764,6 +764,7 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -764,6 +764,7 @@ class ZCatalog(Folder, Persistent, Implicit):
if archive_enabled: if archive_enabled:
default_catalog = self.getSQLCatalog() default_catalog = self.getSQLCatalog()
predicate = catalog.asPredicate()
# Construct list of object to catalogged # Construct list of object to catalogged
for obj in object_list: for obj in object_list:
if hot_reindexing: if hot_reindexing:
...@@ -804,8 +805,9 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -804,8 +805,9 @@ class ZCatalog(Folder, Persistent, Implicit):
if goto_current_catalog: if goto_current_catalog:
# wrap object only when sure it will be reindex now # wrap object only when sure it will be reindex now
# thus security uid is also reindex # thus security uid is also reindex
wrap_obj = self.wrapObject(obj, sql_catalog_id=sql_catalog_id) if predicate.test(obj):
wrapped_object_list.append(wrap_obj) wrap_obj = self.wrapObject(obj, sql_catalog_id=sql_catalog_id)
wrapped_object_list.append(wrap_obj)
# run activity or execute for each archive depending on priority # run activity or execute for each archive depending on priority
if catalog_dict: if catalog_dict:
......
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