Commit d6e57a17 authored by Julien Muchembled's avatar Julien Muchembled

Do not notify if an active process finishes. This never worked before r27329...

Do not notify if an active process finishes. This never worked before r27329 and it is now redundant with alarm notification.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27332 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 30026f86
......@@ -338,7 +338,6 @@ class SQLDict(RAMDict, SQLBase):
delay_uid_list = []
final_error_uid_list = []
make_available_uid_list = []
message_with_active_process_list = []
notify_user_list = []
non_executable_message_list = []
something_failed = (len([x for x in message_uid_priority_list if x[1].getExecutionState() == MESSAGE_NOT_EXECUTED]) != 0)
......@@ -350,10 +349,6 @@ class SQLDict(RAMDict, SQLBase):
else:
deletable_uid_list.append(uid)
deletable_uid_list.extend(uid_to_duplicate_uid_list_dict.get(uid, []))
if m.active_process:
# XXX: Bug here: Even if a duplicate message has an active_process,
# it won't be called on the duplicate.
message_with_active_process_list.append(m)
elif m.getExecutionState() == MESSAGE_NOT_EXECUTED:
# Should duplicate messages follow strictly the original message, or
# should they be just made available again ?
......@@ -415,11 +410,6 @@ class SQLDict(RAMDict, SQLBase):
try:
for m in notify_user_list:
m.notifyUser(activity_tool)
for m in message_with_active_process_list:
active_process = activity_tool.unrestrictedTraverse(m.active_process)
if not active_process.hasActivity():
# No more activity
m.notifyUser(activity_tool, message="Process Finished") # XXX commit bas ???
except:
# Notification failures must not cause this method to raise.
LOG('SQLDict', WARNING, 'Exception during notification phase of finalizeMessageExecution', error=sys.exc_info())
......
......@@ -208,14 +208,11 @@ class SQLQueue(RAMQueue, SQLBase):
deletable_uid_list = []
delay_uid_list = []
final_error_uid_list = []
message_with_active_process_list = []
notify_user_list = []
non_executable_message_list = []
for uid, m, priority in message_uid_priority_list:
if m.getExecutionState() == MESSAGE_EXECUTED:
deletable_uid_list.append(uid)
if m.active_process:
message_with_active_process_list.append(m)
elif m.getExecutionState() == MESSAGE_NOT_EXECUTED:
if type(m.exc_type) is ClassType and \
issubclass(m.exc_type, ConflictError):
......@@ -277,11 +274,6 @@ class SQLQueue(RAMQueue, SQLBase):
try:
for m in notify_user_list:
m.notifyUser(activity_tool)
for m in message_with_active_process_list:
active_process = activity_tool.unrestrictedTraverse(m.active_process)
if not active_process.hasActivity():
# No more activity
m.notifyUser(activity_tool, message="Process Finished") # XXX commit bas ???
except:
# Notification failures must not cause this method to raise.
LOG('SQLQueue', WARNING, 'Exception during notification phase of finalizeMessageExecution', error=sys.exc_info())
......
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