Commit c3db1252 by Bryton Lacquement

WSGI: capture SIGTERM to properly shutdown the server

1 parent 6790a3bd
......@@ -3,7 +3,9 @@ from io import BytesIO
import logging
import os
import posixpath
import signal
import socket
import sys
from tempfile import TemporaryFile
import time
from urllib import quote, splitport
......@@ -160,6 +162,9 @@ def runwsgi():
make_wsgi_app({}, zope_conf=args.zope_conf)
from Signals.SignalHandler import SignalHandler
SignalHandler.registerHandler(signal.SIGTERM, lambda: sys.exit(0))
ip, port = splitport(args.address)
port = int(port)
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!