Commit 514df2d6 authored by Yoshinori Okuji's avatar Yoshinori Okuji

For INVALID_ORDER, it is a bad idea to specify processing_node, because...

For INVALID_ORDER, it is a bad idea to specify processing_node, because processMessage may set processing to 1, even if messages are not assigned to a given node. Thus simply specify the uid list instead.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13951 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cff90edc
...@@ -110,7 +110,7 @@ class SQLDict(RAMDict): ...@@ -110,7 +110,7 @@ class SQLDict(RAMDict):
path = '/'.join(m.object_path) path = '/'.join(m.object_path)
order_validation_text = self.getOrderValidationText(m) order_validation_text = self.getOrderValidationText(m)
uid_list = activity_tool.SQLDict_readUidList(path = path, method_id = m.method_id, uid_list = activity_tool.SQLDict_readUidList(path = path, method_id = m.method_id,
order_validation_text = order_validation_text, order_validation_text = order_validation_text,
processing_node = None) processing_node = None)
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:
...@@ -167,11 +167,13 @@ class SQLDict(RAMDict): ...@@ -167,11 +167,13 @@ class SQLDict(RAMDict):
if priority > MAX_PRIORITY: if priority > MAX_PRIORITY:
# This is an error # This is an error
if len(uid_list) > 0: if len(uid_list) > 0:
#LOG('SQLDict', 0, 'error uid_list = %r' % (uid_list,))
activity_tool.SQLDict_assignMessage(uid = uid_list, processing_node = VALIDATE_ERROR_STATE) activity_tool.SQLDict_assignMessage(uid = uid_list, processing_node = VALIDATE_ERROR_STATE)
# Assign message back to 'error' state # Assign message back to 'error' state
#m.notifyUser(activity_tool) # Notify Error #m.notifyUser(activity_tool) # Notify Error
get_transaction().commit() # and commit get_transaction().commit() # and commit
else: else:
#LOG('SQLDict', 0, 'lower priority uid_list = %r' % (uid_list,))
# Lower priority # Lower priority
if len(uid_list) > 0: # Add some delay before new processing if len(uid_list) > 0: # Add some delay before new processing
activity_tool.SQLDict_setPriority(uid = uid_list, delay = VALIDATION_ERROR_DELAY, activity_tool.SQLDict_setPriority(uid = uid_list, delay = VALIDATION_ERROR_DELAY,
...@@ -179,12 +181,10 @@ class SQLDict(RAMDict): ...@@ -179,12 +181,10 @@ class SQLDict(RAMDict):
get_transaction().commit() # Release locks before starting a potentially long calculation get_transaction().commit() # Release locks before starting a potentially long calculation
else: else:
# We do not lower priority for INVALID_ORDER errors but we do postpone execution # We do not lower priority for INVALID_ORDER errors but we do postpone execution
order_validation_text = self.getOrderValidationText(message) #order_validation_text = self.getOrderValidationText(message)
activity_tool.SQLDict_setPriority(order_validation_text = order_validation_text, activity_tool.SQLDict_setPriority(uid = uid_list,
processing_node = processing_node,
delay = VALIDATION_ERROR_DELAY, delay = VALIDATION_ERROR_DELAY,
retry = 1, retry = 1)
uid = None)
get_transaction().commit() # Release locks before starting a potentially long calculation get_transaction().commit() # Release locks before starting a potentially long calculation
return 0 return 0
return 1 return 1
......
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