[Erp5-report] r13951 - /erp5/trunk/products/CMFActivity/Activity/SQLDict.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Apr 5 00:57:14 CEST 2007


Author: yo
Date: Thu Apr  5 00:57:13 2007
New Revision: 13951

URL: http://svn.erp5.org?rev=13951&view=rev
Log:
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.

Modified:
    erp5/trunk/products/CMFActivity/Activity/SQLDict.py

Modified: erp5/trunk/products/CMFActivity/Activity/SQLDict.py
URL: http://svn.erp5.org/erp5/trunk/products/CMFActivity/Activity/SQLDict.py?rev=13951&r1=13950&r2=13951&view=diff
==============================================================================
--- erp5/trunk/products/CMFActivity/Activity/SQLDict.py (original)
+++ erp5/trunk/products/CMFActivity/Activity/SQLDict.py Thu Apr  5 00:57:13 2007
@@ -110,7 +110,7 @@
     path = '/'.join(m.object_path)
     order_validation_text = self.getOrderValidationText(m)
     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)
     uid_list = [x.uid for x in uid_list]
     if len(uid_list)>0:
@@ -167,11 +167,13 @@
         if priority > MAX_PRIORITY:
           # This is an error
           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)
                                                                             # Assign message back to 'error' state
           #m.notifyUser(activity_tool)                                      # Notify Error
           get_transaction().commit()                                        # and commit
         else:
+          #LOG('SQLDict', 0, 'lower priority uid_list = %r' % (uid_list,))
           # Lower priority
           if len(uid_list) > 0: # Add some delay before new processing
             activity_tool.SQLDict_setPriority(uid = uid_list, delay = VALIDATION_ERROR_DELAY,
@@ -179,12 +181,10 @@
           get_transaction().commit() # Release locks before starting a potentially long calculation
       else:
         # We do not lower priority for INVALID_ORDER errors but we do postpone execution
-        order_validation_text = self.getOrderValidationText(message)
-        activity_tool.SQLDict_setPriority(order_validation_text = order_validation_text, 
-                                          processing_node = processing_node,
+        #order_validation_text = self.getOrderValidationText(message)
+        activity_tool.SQLDict_setPriority(uid = uid_list,
                                           delay = VALIDATION_ERROR_DELAY,
-                                          retry = 1,
-                                          uid = None)
+                                          retry = 1)
         get_transaction().commit() # Release locks before starting a potentially long calculation
       return 0
     return 1




More information about the Erp5-report mailing list