From 6af4fd52d147c112c4859b4e022988ec8b7508fc Mon Sep 17 00:00:00 2001 From: Vincent Pelletier <vincent@nexedi.com> Date: Tue, 10 Sep 2019 09:18:00 +0000 Subject: [PATCH] SQLCatalog_deferFullTextIndex: De-hardcode called method. Both the dummy method_id and the actually-used grouping_method_id. --- .../SQLCatalog_deferFullTextIndex.py | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/bt5/erp5_full_text_mroonga_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_deferFullTextIndex.py b/bt5/erp5_full_text_mroonga_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_deferFullTextIndex.py index a8dad6c11b..5838374d30 100644 --- a/bt5/erp5_full_text_mroonga_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_deferFullTextIndex.py +++ b/bt5/erp5_full_text_mroonga_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_deferFullTextIndex.py @@ -1,12 +1,16 @@ # This script is called to defer fulltext indexing in a lower priority. -GROUP_METHOD_ID = context.getPath() + '/SQLCatalog_deferFullTextIndexActivity' +METHOD_ID = script.id + 'Activity' +GROUP_METHOD_ID = context.getPath() + '/' + METHOD_ID activateObject = context.getPortalObject().portal_activities.activateObject for document, root_document_path in zip(getPath, getRootDocumentPath): - activateObject( - document, - activity='SQLQueue', - priority=4, - node='same', - group_method_id=GROUP_METHOD_ID, - serialization_tag='full_text_' + root_document_path, - ).SQLCatalog_deferFullTextIndexActivity() + getattr( + activateObject( + document, + activity='SQLQueue', + priority=4, + node='same', + group_method_id=GROUP_METHOD_ID, + serialization_tag='full_text_' + root_document_path, + ), + METHOD_ID, + )() -- 2.30.9