Commit 5e93ab86 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Fix a bug in broadcasting.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2307 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6a9d16cd
...@@ -295,14 +295,15 @@ class SQLDict(RAMDict): ...@@ -295,14 +295,15 @@ class SQLDict(RAMDict):
# Broadcast messages must be distributed into all nodes. # Broadcast messages must be distributed into all nodes.
uid = line.uid uid = line.uid
activity_tool.SQLDict_assignMessage(processing_node=1, uid=[uid]) activity_tool.SQLDict_assignMessage(processing_node=1, uid=[uid])
for node in range(2, node_count+1): if node_count > 1:
activity_tool.SQLDict_writeMessage( path = path, for node in range(2, node_count+1):
method_id = line.method_id, activity_tool.SQLDict_writeMessage( path = path,
priority = line.priority, method_id = line.method_id,
broadcast = 1, priority = line.priority,
processing_node = node, broadcast = 1,
message = line.message, processing_node = node,
date = line.date) message = line.message,
date = line.date)
elif not path_dict.has_key(path): elif not path_dict.has_key(path):
# Only assign once (it would be different for a queue) # Only assign once (it would be different for a queue)
path_dict[path] = 1 path_dict[path] = 1
......
...@@ -220,14 +220,15 @@ class SQLQueue(RAMQueue): ...@@ -220,14 +220,15 @@ class SQLQueue(RAMQueue):
if broadcast: if broadcast:
# Broadcast messages must be distributed into all nodes. # Broadcast messages must be distributed into all nodes.
activity_tool.SQLQueue_assignMessage(processing_node=1, uid=uid) activity_tool.SQLQueue_assignMessage(processing_node=1, uid=uid)
for node in range(2, node_count+1): if node_count > 1:
activity_tool.SQLQueue_writeMessage( path = line.path, for node in range(2, node_count+1):
method_id = line.method_id, activity_tool.SQLQueue_writeMessage( path = line.path,
priority = line.priority, method_id = line.method_id,
broadcast = 1, priority = line.priority,
processing_node = node, broadcast = 1,
message = line.message, processing_node = node,
date = line.date) message = line.message,
date = line.date)
else: else:
#LOG("distribute", 0, "assign %s" % uid) #LOG("distribute", 0, "assign %s" % uid)
activity_tool.SQLQueue_assignMessage(uid=uid, processing_node=processing_node) activity_tool.SQLQueue_assignMessage(uid=uid, processing_node=processing_node)
......
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