Commit 705896e0 authored by Vincent Pelletier's avatar Vincent Pelletier

Add a "process_shutdown" method to be invoked asynchronously by a tic in every...

Add a "process_shutdown" method to be invoked asynchronously by a tic in every shutdown phase (see Lifetime.py) when Zope shutdown sequence is runing.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22386 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d1c27c75
......@@ -50,6 +50,26 @@ class TimerService(SimpleItem):
self._subscribers = []
self._version = 1
security.declarePublic('process_shutdown')
def process_shutdown(self, phase, time_in_phase):
""" """
subscriptions = []
try:
subscriptions = [self.unrestrictedTraverse(path)
for path in self._subscribers]
except KeyError:
pass
for subscriber in subscriptions:
process_shutdown = getattr(subscriber, 'process_shutdown', None)
if process_shutdown is not None:
try:
subscriber.process_shutdown(phase=phase,
time_in_phase=time_in_phase)
except:
LOG('TimerService', ERROR, 'Process shutdown error',
error = sys.exc_info())
raise
security.declarePublic('process_timer')
def process_timer(self, interval):
""" """
......
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