Commit 7a1966b9 authored by Łukasz Nowak's avatar Łukasz Nowak Committed by Alain Takoudjou

Improve Alarm_updateOpenOrderSimulation: optimize params, Minimise transaction...

Improve Alarm_updateOpenOrderSimulation: optimize params, Minimise transaction size and reduce priority.

params can be None so for simplicity set it to {}

Conflicts:
	bt5/erp5_open_trade/bt/revision

Minimise transaction size.

Conflicts:
	bt5/erp5_open_trade/bt/revision

Lower priority.

Alarm can generate a lot of activities, so run them less often then critical
ones.

Conflicts:
	bt5/erp5_open_trade/bt/revision
parent 96c10a67
...@@ -53,6 +53,8 @@ ...@@ -53,6 +53,8 @@
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
kw = {}\n kw = {}\n
if params is None:\n
params = {}\n
\n \n
last_active_process = context.getLastActiveProcess()\n last_active_process = context.getLastActiveProcess()\n
\n \n
...@@ -68,9 +70,10 @@ portal = context.getPortalObject()\n ...@@ -68,9 +70,10 @@ portal = context.getPortalObject()\n
kw[\'portal_type\'] = portal.getPortalOpenOrderTypeList()\n kw[\'portal_type\'] = portal.getPortalOpenOrderTypeList()\n
\n \n
portal.portal_catalog.searchAndActivate(\n portal.portal_catalog.searchAndActivate(\n
method_id=\'OpenOrder_updateSimulation\', # XXX: OpenOrder_updateSimulation can generate big transaction...\n method_id=\'OpenOrder_updateSimulation\',\n
method_kw={\'activity\': False},\n method_kw={\'activity\': False},\n
activate_kw={\'tag\':tag},\n packet_size=1, # As OpenOrder_updateSimulation can generate big transaction separate the calls\n
activate_kw={\'tag\':tag, \'priority\': 8},\n
**kw # XXX: In one query put parents of last modified lines\n **kw # XXX: In one query put parents of last modified lines\n
)\n )\n
\n \n
......
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