Commit 4ab650cc authored by Vincent Pelletier's avatar Vincent Pelletier

Add logs aound post-business-template-install reindexing, to know how long it...

Add logs aound post-business-template-install reindexing, to know how long it takes, and how many messages are processed.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19332 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7a0a8183
...@@ -676,11 +676,20 @@ def setupERP5Site( business_template_list=(), ...@@ -676,11 +676,20 @@ def setupERP5Site( business_template_list=(),
portal_activities = getattr(portal, 'portal_activities', None) portal_activities = getattr(portal, 'portal_activities', None)
if portal_activities is not None: if portal_activities is not None:
if not quiet:
ZopeTestCase._print('Executing pending activities ... ')
start = time.time()
count = 1000 count = 1000
while len(portal_activities.getMessageList()) > 0: message_count = len(portal_activities.getMessageList())
while message_count > 0:
portal_activities.distribute() portal_activities.distribute()
portal_activities.tic() portal_activities.tic()
get_transaction().commit() get_transaction().commit()
new_message_count = len(portal_activities.getMessageList())
if new_message_count != message_count:
if not quiet:
ZopeTestCase._print('%i ' % (message_count, ))
message_count = new_message_count
count -= 1 count -= 1
if count == 0: if count == 0:
raise RuntimeError, \ raise RuntimeError, \
...@@ -688,6 +697,8 @@ def setupERP5Site( business_template_list=(), ...@@ -688,6 +697,8 @@ def setupERP5Site( business_template_list=(),
[('/'.join(m.object_path), m.method_id, [('/'.join(m.object_path), m.method_id,
m.processing_node, m.priority) m.processing_node, m.priority)
for m in portal_activities.getMessageList()],) for m in portal_activities.getMessageList()],)
if not quiet:
ZopeTestCase._print('done (%.3fs)\n' % (time.time() - start))
# Reset aq dynamic, so all unit tests will start again # Reset aq dynamic, so all unit tests will start again
_aq_reset() _aq_reset()
......
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