Commit af766075 authored by Jean-Paul Smets's avatar Jean-Paul Smets

fixed


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@743 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 25a25094
......@@ -64,15 +64,19 @@ class RAMQueue(Queue):
def dequeueMessage(self, activity_tool, processing_node):
if len(self.getQueue(activity_tool)) is 0:
return 1 # Go to sleep
if not m.validate(self, activity_tool):
self.deleteMessage(activity_tool, m) # Trash messages which are not validated (no error handling)
get_transaction().commit()
return 0 # Keep on ticking
activity_tool.invoke(m)
if m.is_executed:
self.deleteMessage(activity_tool, m) # Trash messages which are not validated (no error handling)
get_transaction().commit()
return 0 # Keep on ticking
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)
get_transaction().commit()
return 0 # Keep on ticking
activity_tool.invoke(m)
if m.is_executed:
self.deleteMessage(activity_tool, m) # Trash messages which are not validated (no error handling)
get_transaction().commit()
return 0 # Keep on ticking
else:
# Start a new transaction and keep on to next message
get_transaction().commit()
def hasActivity(self, activity_tool, object, **kw):
object_path = object.getPhysicalPath()
......
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