Commit ef905241 authored by Alexandre Boeglin's avatar Alexandre Boeglin

Fixes "ActivityBuffer instance has no attribute '_activity_tool'" when

restarting the site with only failed activities in the queue (#253).


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@7291 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f2e9b1a8
......@@ -36,13 +36,15 @@ class ActivityBuffer(TM):
_p_oid=_p_changed=_registered=None
def __init__(self):
def __init__(self, activity_tool=None):
from thread import allocate_lock
self._use_TM = self._transactions = 1
if self._use_TM:
self._tlock = allocate_lock()
self._tthread = None
self._lock = allocate_lock()
if activity_tool is not None:
self._activity_tool = activity_tool
# Keeps a list of messages to add and remove
# at end of transaction
......
......@@ -609,7 +609,7 @@ class ActivityTool (Folder, UniqueObject):
global is_initialized
if not is_initialized: self.initialize()
if getattr(self, '_v_activity_buffer', None) is None:
self._v_activity_buffer = ActivityBuffer()
self._v_activity_buffer = ActivityBuffer(activity_tool=self)
return ActiveWrapper(object, activity, active_process, **kw)
def deferredQueueMessage(self, activity, message):
......@@ -617,7 +617,7 @@ class ActivityTool (Folder, UniqueObject):
def deferredDeleteMessage(self, activity, message):
if getattr(self, '_v_activity_buffer', None) is None:
self._v_activity_buffer = ActivityBuffer()
self._v_activity_buffer = ActivityBuffer(activity_tool=self)
self._v_activity_buffer.deferredDeleteMessage(self, activity, message)
def getRegisteredMessageList(self, activity):
......@@ -636,7 +636,7 @@ class ActivityTool (Folder, UniqueObject):
global is_initialized
if not is_initialized: self.initialize()
if getattr(self, '_v_activity_buffer', None) is None:
self._v_activity_buffer = ActivityBuffer()
self._v_activity_buffer = ActivityBuffer(activity_tool=self)
if type(object) is TupleType:
object_path = object
else:
......@@ -763,7 +763,7 @@ class ActivityTool (Folder, UniqueObject):
global is_initialized
if not is_initialized: self.initialize()
if getattr(self, '_v_activity_buffer', None) is None:
self._v_activity_buffer = ActivityBuffer()
self._v_activity_buffer = ActivityBuffer(activity_tool=self)
activity_dict[activity].queueMessage(self,
Message(path, active_process, activity_kw, method_id, args, kw))
......
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