Commit 27bd8063 authored by Vincent Pelletier's avatar Vincent Pelletier

SQLQueue do not balances activities, it gives them all to a single node. So...

SQLQueue do not balances activities, it gives them all to a single node. So remove multi-node related code for cases where message is not marked as broadcast.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16292 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 35f0a201
...@@ -318,9 +318,7 @@ class SQLQueue(RAMQueue): ...@@ -318,9 +318,7 @@ class SQLQueue(RAMQueue):
validation_text_dict) validation_text_dict)
# XXX probably this below can be optimized by assigning multiple messages at a time. # XXX probably this below can be optimized by assigning multiple messages at a time.
path_dict = {}
assignMessage = activity_tool.SQLQueue_assignMessage assignMessage = activity_tool.SQLQueue_assignMessage
processing_node = 1
id_tool = activity_tool.getPortalObject().portal_ids 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)
...@@ -347,17 +345,6 @@ class SQLQueue(RAMQueue): ...@@ -347,17 +345,6 @@ class SQLQueue(RAMQueue):
tag=tag) tag=tag)
get_transaction().commit() get_transaction().commit()
else: else:
# Select a processing node. If the same path appears again, dispatch the message to
# the same node, so that object caching is more efficient. Otherwise, apply a round
# robin scheduling.
node = path_dict.get(path)
if node is None:
node = processing_node
path_dict[path] = node
processing_node += 1
if processing_node > node_count:
processing_node = 1
assignMessage(processing_node=node, uid=message.uid, broadcast=0) assignMessage(processing_node=node, uid=message.uid, broadcast=0)
get_transaction().commit() # Release locks immediately to allow processing of messages get_transaction().commit() # Release locks immediately to allow processing of messages
......
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