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 = []
for path in self._subscribers:
try: try:
subscriptions = [self.unrestrictedTraverse(path) subscriptions.append(self.unrestrictedTraverse(path))
for path in self._subscribers]
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,9 +85,9 @@ class TimerService(SimpleItem): ...@@ -84,9 +85,9 @@ 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 = []
for path in self._subscribers:
try: try:
subscriptions = [self.unrestrictedTraverse(path) subscriptions.append(self.unrestrictedTraverse(path))
for path in self._subscribers]
except KeyError: except KeyError:
pass pass
......
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