Commit dcb873b7 authored by Rafael Monnerat's avatar Rafael Monnerat

WSGI: Start timerserver from wsgi script

See merge request nexedi/erp5!1534
parents f70bc102 78e9394f
......@@ -158,6 +158,7 @@ def runwsgi():
parser.add_argument('-w', '--webdav', action='store_true')
parser.add_argument('address', help='<ip>:<port>')
parser.add_argument('zope_conf', help='path to zope.conf')
parser.add_argument('--timerserver-interval', help='Interval for timerserver', type=float)
args = parser.parse_args()
startup = os.path.dirname(Zope2.Startup.__file__)
......@@ -169,6 +170,13 @@ def runwsgi():
from Signals.SignalHandler import SignalHandler
SignalHandler.registerHandler(signal.SIGTERM, sys.exit)
if args.timerserver_interval:
import Products.TimerService
Products.TimerService.timerserver.TimerServer.TimerServer(
module='Zope2',
interval=args.timerserver_interval,
)
ip, port = splitport(args.address)
port = int(port)
createServer(
......
......@@ -101,8 +101,8 @@ class TimerServer(threading.Thread):
err = StringIO()
response = TimerResponse(out, err)
handle(module, TimerRequest(response, interval), response)
except:
pass
except Exception:
logger.warn("Ignoring exception in run loop", exc_info=True)
TIMER_SERVICE_PATH = '/Control_Panel/timer_service'
......@@ -110,7 +110,7 @@ TIMER_ENVIRON = {
'REQUEST_METHOD': 'GET',
'SERVER_SOFTWARE': 'TimerServer for Zope',
'SERVER_NAME': '',
'SERVER_PORT': '',
'SERVER_PORT': '-1',
'REMOTE_ADDR': '',
'GATEWAY_INTERFACE': 'CGI/1.1',
'SERVER_PROTOCOL': 'HTTP/1.0',
......
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