Commit a32c8a42 authored by Julien Muchembled's avatar Julien Muchembled

CMFActivity: do not refresh view too often when checking messages dependencies

The root call to getExecutableMessageList (i.e. the one from distribute)
is fast enough and won't hold old revisions of the database for too long.
It is also completely read-only so it won't lock anything.

This caused useless communication with the server.
parent 9fe1d68d
...@@ -33,8 +33,6 @@ from zLOG import LOG, WARNING, ERROR ...@@ -33,8 +33,6 @@ from zLOG import LOG, WARNING, ERROR
from ZODB.POSException import ConflictError from ZODB.POSException import ConflictError
from cStringIO import StringIO from cStringIO import StringIO
import transaction
# Time global parameters # Time global parameters
MAX_PROCESSING_TIME = 900 # in seconds MAX_PROCESSING_TIME = 900 # in seconds
VALIDATION_ERROR_DELAY = 15 # in seconds VALIDATION_ERROR_DELAY = 15 # in seconds
...@@ -114,7 +112,6 @@ class Queue(object): ...@@ -114,7 +112,6 @@ class Queue(object):
cached_result = validation_text_dict.get(message.order_validation_text) cached_result = validation_text_dict.get(message.order_validation_text)
if cached_result is None: if cached_result is None:
message_list = activity_tool.getDependentMessageList(message, self) message_list = activity_tool.getDependentMessageList(message, self)
transaction.commit() # Release locks.
if message_list: if message_list:
# The result is not empty, so this message is not executable. # The result is not empty, so this message is not executable.
validation_text_dict[message.order_validation_text] = 0 validation_text_dict[message.order_validation_text] = 0
......
...@@ -329,6 +329,7 @@ class SQLBase(Queue): ...@@ -329,6 +329,7 @@ class SQLBase(Queue):
message.order_validation_text = self.getOrderValidationText(message) message.order_validation_text = self.getOrderValidationText(message)
self.getExecutableMessageList(activity_tool, message, message_dict, self.getExecutableMessageList(activity_tool, message, message_dict,
validation_text_dict, now_date=now_date) validation_text_dict, now_date=now_date)
transaction.commit()
if message_dict: if message_dict:
distributable_uid_set = set() distributable_uid_set = set()
serialization_tag_dict = {} serialization_tag_dict = {}
......
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