Commit e003c9bc authored by Bryton Lacquement's avatar Bryton Lacquement 🚪

WSGI: capture SIGTERM to properly shutdown the server

parent 68cabf53
......@@ -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, sys.exit)
ip, port = splitport(args.address)
port = int(port)
createServer(
......
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