Commit 2a1c555d authored by Yusei Tahara's avatar Yusei Tahara

Fixed a bug which disable all subscribers includes existing ones.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25007 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 23dbb236
# -*- coding: UTF-8 -*- # -*- coding: utf-8 -*-
# -*- Mode: Python; py-indent-offset: 4 -*- # -*- Mode: Python; py-indent-offset: 4 -*-
# Authors: Nik Kim <fafhrd@legco.biz> # Authors: Nik Kim <fafhrd@legco.biz>
__version__ = '$Revision: 1.3 $'[11:-2] __version__ = '$Revision: 1.3 $'[11:-2]
...@@ -9,7 +9,7 @@ from Globals import InitializeClass ...@@ -9,7 +9,7 @@ from Globals import InitializeClass
from OFS.SimpleItem import SimpleItem from OFS.SimpleItem import SimpleItem
from OFS.PropertyManager import PropertyManager from OFS.PropertyManager import PropertyManager
from zLOG import LOG, INFO, ERROR from zLOG import LOG, ERROR
from AccessControl import ClassSecurityInfo, Permissions from AccessControl import ClassSecurityInfo, Permissions
from Products.PageTemplates.PageTemplateFile import PageTemplateFile from Products.PageTemplates.PageTemplateFile import PageTemplateFile
...@@ -54,11 +54,12 @@ class TimerService(SimpleItem): ...@@ -54,11 +54,12 @@ class TimerService(SimpleItem):
def process_shutdown(self, phase, time_in_phase): def process_shutdown(self, phase, time_in_phase):
""" """ """ """
subscriptions = [] subscriptions = []
try: for path in self._subscribers:
subscriptions = [self.unrestrictedTraverse(path) try:
for path in self._subscribers] subscriptions.append(self.unrestrictedTraverse(path))
except KeyError: except KeyError:
pass pass
for subscriber in subscriptions: for subscriber in subscriptions:
process_shutdown = getattr(subscriber, 'process_shutdown', None) process_shutdown = getattr(subscriber, 'process_shutdown', None)
if process_shutdown is not None: if process_shutdown is not None:
...@@ -84,11 +85,11 @@ class TimerService(SimpleItem): ...@@ -84,11 +85,11 @@ class TimerService(SimpleItem):
# Service start to 'ping' the portal before the zope transaction in # Service start to 'ping' the portal before the zope transaction in
# which the portal is created is commited. # which the portal is created is commited.
subscriptions = [] subscriptions = []
try: for path in self._subscribers:
subscriptions = [self.unrestrictedTraverse(path) try:
for path in self._subscribers] subscriptions.append(self.unrestrictedTraverse(path))
except KeyError: except KeyError:
pass pass
tick = time.time() tick = time.time()
prev_tick = tick - interval prev_tick = tick - 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