Sometimes the HTTP interface wouldn't manage to shut its threads down.

This commit is contained in:
Paulus Schoutsen 2013-09-28 14:55:03 -07:00
parent cfa27c25a8
commit 1988b5ed79
1 changed files with 4 additions and 1 deletions

View File

@ -74,7 +74,10 @@ class HTTPInterface(threading.Thread):
self._stop.set()
# Trigger a fake request to get the server to quit
requests.get("http://127.0.0.1:{}".format(SERVER_PORT))
try:
requests.get("http://127.0.0.1:{}".format(SERVER_PORT), timeout=0.001)
except requests.TimeOut:
pass
class RequestHandler(BaseHTTPRequestHandler):
""" Handles incoming HTTP requests """