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): ...@@ -64,15 +64,19 @@ class RAMQueue(Queue):
def dequeueMessage(self, activity_tool, processing_node): def dequeueMessage(self, activity_tool, processing_node):
if len(self.getQueue(activity_tool)) is 0: if len(self.getQueue(activity_tool)) is 0:
return 1 # Go to sleep return 1 # Go to sleep
if not m.validate(self, activity_tool): for m in self.getQueue(activity_tool):
self.deleteMessage(activity_tool, m) # Trash messages which are not validated (no error handling) if not m.validate(self, activity_tool):
get_transaction().commit() self.deleteMessage(activity_tool, m) # Trash messages which are not validated (no error handling)
return 0 # Keep on ticking get_transaction().commit()
activity_tool.invoke(m) return 0 # Keep on ticking
if m.is_executed: activity_tool.invoke(m)
self.deleteMessage(activity_tool, m) # Trash messages which are not validated (no error handling) if m.is_executed:
get_transaction().commit() self.deleteMessage(activity_tool, m) # Trash messages which are not validated (no error handling)
return 0 # Keep on ticking 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): def hasActivity(self, activity_tool, object, **kw):
object_path = object.getPhysicalPath() 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