Commit 38bd97d6 authored by Aurel's avatar Aurel

registerMessage must take into account group_id

pass group_method_id parameter when reading uid for a group


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15493 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 87542f6c
......@@ -123,12 +123,12 @@ class SQLDict(RAMDict):
def isMessageRegistered(self, activity_buffer, activity_tool, m):
uid_set = activity_buffer.getUidSet(self)
return (tuple(m.object_path), m.method_id, m.activity_kw.get('tag')) in uid_set
return (tuple(m.object_path), m.method_id, m.activity_kw.get('tag'), m.activity_kw.get('group_id')) in uid_set
def registerMessage(self, activity_buffer, activity_tool, m):
m.is_registered = 1
uid_set = activity_buffer.getUidSet(self)
uid_set.add((tuple(m.object_path), m.method_id, m.activity_kw.get('tag')))
uid_set.add((tuple(m.object_path), m.method_id, m.activity_kw.get('tag'), m.activity_kw.get('group_id')))
message_list = activity_buffer.getMessageList(self)
message_list.append(m)
......@@ -136,7 +136,7 @@ class SQLDict(RAMDict):
m.is_registered = 0 # This prevents from inserting deleted messages into the queue
class_name = self.__class__.__name__
uid_set = activity_buffer.getUidSet(self)
uid_set.discard((tuple(m.object_path), m.method_id, m.activity_kw.get('tag')))
uid_set.discard((tuple(m.object_path), m.method_id, m.activity_kw.get('tag'), m.activity_kw.get('group_id')))
def getRegisteredMessageList(self, activity_buffer, activity_tool):
message_list = activity_buffer.getMessageList(self)
......@@ -212,7 +212,7 @@ class SQLDict(RAMDict):
result = readMessage(processing_node=processing_node,
to_date=now_date, group_method_id=group_method_id,
order_validation_text=order_validation_text)
#LOG('SQLDict dequeueMessage', 0, 'result = %d' % (len(result)))
#LOG('SQLDict dequeueMessage', 0, 'result = %d, group_method_id %s' % (len(result), group_method_id))
path_and_method_id_dict = {}
for line in result:
path = line.path
......@@ -226,7 +226,7 @@ class SQLDict(RAMDict):
uid_list = activity_tool.SQLDict_readUidList(path=path, method_id=method_id,
processing_node=None,
to_date=now_date,
to_date=now_date, group_method_id=group_method_id,
order_validation_text=order_validation_text)
uid_list = [x.uid for x in uid_list]
if len(uid_list) > 0:
......
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