Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: cms/bin/test_server.py

Issue 29327611: Issue 3056 - [cms] Enable threading for the test server (Closed)
Patch Set: Created Sept. 15, 2015, 6:32 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld