Index: cms/bin/test_server.py |
=================================================================== |
--- a/cms/bin/test_server.py |
+++ b/cms/bin/test_server.py |
@@ -134,9 +134,14 @@ |
logger.setLevel(logging.INFO) |
logger.addHandler(logging.StreamHandler()) |
- run_simple(*args, **kwargs) |
+ run_simple(threaded=True, *args, **kwargs) |
except ImportError: |
- from wsgiref.simple_server import make_server |
+ from SocketServer import ThreadingMixIn |
+ from wsgiref.simple_server import WSGIServer, make_server |
+ |
+ class ThreadedWSGIServer(ThreadingMixIn, WSGIServer): |
kzar
2015/09/15 08:41:41
Perhaps we should set the daemon_threads attribute
Sebastian Noack
2015/09/15 15:23:12
I agree that it would be preferable to have all th
|
+ pass |
+ |
def run(host, port, app, **kwargs): |
def wrapper(environ, start_response): |
try: |
@@ -145,7 +150,7 @@ |
return show_error(start_response, "500 Internal Server Error", |
uri=environ.get("PATH_INFO"), error=e) |
- server = make_server(host, port, wrapper) |
+ server = make_server(host, port, wrapper, ThreadedWSGIServer) |
print " * Running on http://%s:%i/" % server.server_address |
server.serve_forever() |