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

Portal ids will not change between 2 activity store, so better do the traversal just once.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14040 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1c300e5c
...@@ -477,6 +477,7 @@ class SQLDict(RAMDict): ...@@ -477,6 +477,7 @@ class SQLDict(RAMDict):
path_dict = {} path_dict = {}
assignMessage = activity_tool.SQLDict_assignMessage assignMessage = activity_tool.SQLDict_assignMessage
processing_node = 1 processing_node = 1
id_tool = activity_tool.getPortalObject().portal_ids
for message in message_dict.itervalues(): for message in message_dict.itervalues():
path = '/'.join(message.object_path) path = '/'.join(message.object_path)
broadcast = message.activity_kw.get('broadcast', 0) broadcast = message.activity_kw.get('broadcast', 0)
...@@ -485,7 +486,6 @@ class SQLDict(RAMDict): ...@@ -485,7 +486,6 @@ class SQLDict(RAMDict):
uid = message.uid uid = message.uid
assignMessage(processing_node=1, uid=[uid]) assignMessage(processing_node=1, uid=[uid])
if node_count > 1: if node_count > 1:
id_tool = activity_tool.getPortalObject().portal_ids
uid_list = id_tool.generateNewLengthIdList(id_group='portal_activity', uid_list = id_tool.generateNewLengthIdList(id_group='portal_activity',
id_count=node_count - 1) id_count=node_count - 1)
path_list = [path] * (node_count - 1) path_list = [path] * (node_count - 1)
......
...@@ -321,6 +321,7 @@ class SQLQueue(RAMQueue): ...@@ -321,6 +321,7 @@ class SQLQueue(RAMQueue):
path_dict = {} path_dict = {}
assignMessage = activity_tool.SQLQueue_assignMessage assignMessage = activity_tool.SQLQueue_assignMessage
processing_node = 1 processing_node = 1
id_tool = activity_tool.getPortalObject().portal_ids
for message in message_dict.itervalues(): for message in message_dict.itervalues():
path = '/'.join(message.object_path) path = '/'.join(message.object_path)
broadcast = message.activity_kw.get('broadcast', 0) broadcast = message.activity_kw.get('broadcast', 0)
...@@ -328,7 +329,6 @@ class SQLQueue(RAMQueue): ...@@ -328,7 +329,6 @@ class SQLQueue(RAMQueue):
# Broadcast messages must be distributed into all nodes. # Broadcast messages must be distributed into all nodes.
assignMessage(processing_node=1, uid=message.uid) assignMessage(processing_node=1, uid=message.uid)
if node_count > 1: if node_count > 1:
id_tool = activity_tool.getPortalObject().portal_ids
uid_list = id_tool.generateNewLengthIdList(id_group='portal_activity_queue', uid_list = id_tool.generateNewLengthIdList(id_group='portal_activity_queue',
id_count=node_count - 1) id_count=node_count - 1)
priority = message.activity_kw.get('priority', 1) priority = message.activity_kw.get('priority', 1)
......
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