Commit 98bd9dd7 authored by Sebastien Robin's avatar Sebastien Robin

message with errors are not deleted with ramqueue


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@746 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e3d61ebe
......@@ -62,8 +62,6 @@ class RAMQueue(Queue):
i = i + 1
def dequeueMessage(self, activity_tool, processing_node):
if len(self.getQueue(activity_tool)) is 0:
return 1 # Go to sleep
for m in self.getQueue(activity_tool):
if not m.validate(self, activity_tool):
self.deleteMessage(activity_tool, m) # Trash messages which are not validated (no error handling)
......@@ -76,7 +74,9 @@ class RAMQueue(Queue):
return 0 # Keep on ticking
else:
# Start a new transaction and keep on to next message
get_transaction().commit()
get_transaction().commit()
return 1 # Go to sleep
def hasActivity(self, activity_tool, object, **kw):
object_path = object.getPhysicalPath()
......@@ -102,14 +102,14 @@ class RAMQueue(Queue):
for m in self.getQueue(activity_tool):
if object_path == m.object_path and (method_id is None or method_id == m.method_id):
if not m.validate(self, activity_tool):
activity_tool.deleteMessage(self, m) # Trash messages which are not validated (no error handling)
self.deleteMessage(activity_tool, m) # Trash messages which are not validated (no error handling)
else:
if invoke:
activity_tool.invoke(m)
if m.is_executed:
activity_tool.deleteMessage(self, m) # Only delete if no error happens
self.deleteMessage(activity_tool, m) # Only delete if no error happens
else:
activity_tool.deleteMessage(self, m)
self.deleteMessage(activity_tool, m)
def getMessageList(self, activity_tool, processing_node=None):
new_queue = []
......
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