Commit 8f3b7751 by Julien Muchembled

Force use of the new TimerServer

By importing the new TimerService unconditionally,
the commit 34c81caf
(Timeout: introduce publisher_timeout configuration)
broke automatic site creation & publisher timeout
when the zope config specifies the old timerserver.
1 parent bbb46d26
......@@ -2485,16 +2485,7 @@ def initialize(self):
'MySQL error while trying to create ERP5 site. Retrying...',
error=1)
time.sleep(5)
try:
TimerServer = sys.modules['Products.TimerService.timerserver.TimerServer']
except KeyError:
try: # BBB
TimerServer = sys.modules['timerserver.TimerServer']
except KeyError:
# There's no point installing ERP5 automatically
# if there's no timer service configured.
return
TimerRequest = TimerServer.TimerRequest
from Products.TimerService.timerserver.TimerServer import TimerRequest
def traverse(*args, **kw):
del TimerRequest.traverse
return addERP5Site
......
......@@ -2,6 +2,7 @@
# -*- Mode: Python; py-indent-offset: 4 -*-
# Authors: Nik Kim <fafhrd@legco.biz>
import sys
from App.ImageFile import ImageFile
from .TimerService import TimerService, current_version
......@@ -25,3 +26,13 @@ def getTimerService(context):
control_panel._delObject(cp_id)
root._setObject(cp_id, timer_service)
return timer_service
try:
old = sys.modules['timerserver']
except KeyError:
pass
else: # BBB: old timerserver loaded from zope config, force use of new one
assert 'timerserver.TimerServer' not in sys.modules
from .timerserver import TimerServerFactory
old.TimerServerFactory.create = TimerServerFactory.create.__func__
del old, TimerServerFactory
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!