Commit 2689e6b1 authored by Rafael Monnerat's avatar Rafael Monnerat

Make build faster

 - Check if the bt5 is already installed, this is not a change of behaviour, just a performance improvement
 - Cache getInstalledBusinessTemplateTitleList, because it doesn't change during the build and it is a bit time consuming do it so often.
 - Use activate and install_dependency, this can make bt5 list shorter and make core relies on BT5 definitions.
 - Build should wait for updateBusinessTemplateFromUrl
 - Automatic Dependence handling updateBusinessTemplateFromUrl is invoked using activities.
parent e6fb20ab
......@@ -353,8 +353,9 @@ class BusinessConfiguration(Item):
actions and Configurator requets
"""
kw = dict(tag="start_configuration_%s" % self.getId(),
after_method_id=["recursiveImmediateReindexObject",
'immediateReindexObject'])
after_method_id=["updateBusinessTemplateFromUrl",
"recursiveImmediateReindexObject",
"immediateReindexObject"])
start = time.time()
LOG("CONFIGURATOR", INFO,
'Build process started for %s' % self.getRelativeUrl())
......
......@@ -31,6 +31,7 @@ from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, interfaces
from Products.ERP5Type.XMLObject import XMLObject
from Products.ERP5Configurator.mixin.configurator_item import ConfiguratorItemMixin
from Products.ERP5Type.Cache import CachingMethod
from zLOG import LOG, INFO
class StandardBT5ConfiguratorItem(ConfiguratorItemMixin, XMLObject):
......@@ -61,10 +62,6 @@ class StandardBT5ConfiguratorItem(ConfiguratorItemMixin, XMLObject):
def _build(self, business_configuration):
template_tool = self.getPortalObject().portal_templates
bt5_id = self.getBt5Id().split('.')[0]
for bt5 in template_tool.getRepositoryBusinessTemplateList():
if bt5_id == bt5.getTitle():
template_tool.installBusinessTemplateListFromRepository([bt5_id],
update_catalog=self.getUpdateCatalog(0))
if bt5_id in template_tool.getInstalledBusinessTemplateTitleList():
LOG("StandardBT5ConfiguratorItem", INFO,
......
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