Commit cec6ce61 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Set processing_node in SQLDict_processMessage, so that the processing states...

Set processing_node in SQLDict_processMessage, so that the processing states of messages are reset correctly when Zope is restarted.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14153 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5569f904
...@@ -181,7 +181,8 @@ class SQLDict(RAMDict): ...@@ -181,7 +181,8 @@ class SQLDict(RAMDict):
# Make sure message can not be processed anylonger # Make sure message can not be processed anylonger
if len(uid_list) > 0: if len(uid_list) > 0:
# Set selected messages to processing # Set selected messages to processing
activity_tool.SQLDict_processMessage(uid=uid_list) activity_tool.SQLDict_processMessage(uid=uid_list,
processing_node=processing_node)
get_transaction().commit() # Release locks before starting a potentially long calculation get_transaction().commit() # Release locks before starting a potentially long calculation
# This may lead (1 for 1,000,000 in case of reindexing) to messages left in processing state # This may lead (1 for 1,000,000 in case of reindexing) to messages left in processing state
...@@ -228,7 +229,8 @@ class SQLDict(RAMDict): ...@@ -228,7 +229,8 @@ class SQLDict(RAMDict):
uid_list = [x.uid for x in uid_list] uid_list = [x.uid for x in uid_list]
if len(uid_list) > 0: if len(uid_list) > 0:
# Set selected messages to processing # Set selected messages to processing
activity_tool.SQLDict_processMessage(uid=uid_list) activity_tool.SQLDict_processMessage(uid=uid_list,
processing_node=processing_node)
get_transaction().commit() # Release locks before starting a potentially long calculation get_transaction().commit() # Release locks before starting a potentially long calculation
# Save this newly marked uids as soon as possible. # Save this newly marked uids as soon as possible.
......
...@@ -7,11 +7,13 @@ cache_time:0 ...@@ -7,11 +7,13 @@ cache_time:0
class_name: class_name:
class_file: class_file:
</dtml-comment> </dtml-comment>
<params>uid</params> <params>uid
processing_node</params>
UPDATE message UPDATE message
SET SET
processing_date = <dtml-sqlvar "_.DateTime()" type="datetime">, processing_date = <dtml-sqlvar "_.DateTime()" type="datetime">,
processing = 1 processing = 1,
processing_node = <dtml-sqlvar processing_node type="int">
WHERE WHERE
uid IN ( uid IN (
<dtml-in uid><dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else>,</dtml-if></dtml-in> <dtml-in uid><dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else>,</dtml-if></dtml-in>
......
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