Commit 21b126b1 authored by Kevin Deldycke's avatar Kevin Deldycke

Third patch; See http://svn.erp5.org/?rev=8067&view=rev for details

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11929 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8d935010
...@@ -57,15 +57,21 @@ class TimerService(SimpleItem): ...@@ -57,15 +57,21 @@ class TimerService(SimpleItem):
if not acquired: if not acquired:
return return
# Don't let TimerService crash when the ERP5Site is not yet existing.
# This case append when we create a new Portal: At that step Timer Service start
# to 'ping' the portal before the zope transaction in which the portal is
# created is commited.
subscriptions = []
try:
subscriptions = [self.unrestrictedTraverse(path) subscriptions = [self.unrestrictedTraverse(path)
for path in self._subscribers] for path in self._subscribers]
except KeyError:
pass
tick = time.time() tick = time.time()
prev_tick = tick - interval prev_tick = tick - interval
next_tick = tick + interval next_tick = tick + interval
# LOG('TimerService', INFO, 'Ttimer tick at %s\n'%time.ctime(tick))
for subscriber in subscriptions: for subscriber in subscriptions:
try: try:
subscriber.process_timer( subscriber.process_timer(
...@@ -80,9 +86,6 @@ class TimerService(SimpleItem): ...@@ -80,9 +86,6 @@ class TimerService(SimpleItem):
""" """ """ """
path = '/'.join(ob.getPhysicalPath()) path = '/'.join(ob.getPhysicalPath())
#if not ISMTPHandler.isImplementedBy(ob):
# raise ValueError, 'Object not support ISMTPHandler'
subscribers = self._subscribers subscribers = self._subscribers
if path not in subscribers: if path not in subscribers:
subscribers.append(path) subscribers.append(path)
......
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