remove stopped users from proxy on startup

We already added running users, but we didn't handle removing users from the proxy
if the user's server was stopped (e.g. while the Hub was restarting).
This commit is contained in:
Min RK
2016-09-26 13:20:42 +02:00
parent 13826a41a1
commit aad063e3cd
3 changed files with 14 additions and 15 deletions

View File

@@ -1112,7 +1112,7 @@ class JupyterHub(Application):
if self.proxy.public_server.is_up() or self.proxy.api_server.is_up():
# check for *authenticated* access to the proxy (auth token can change)
try:
yield self.proxy.get_routes()
routes = yield self.proxy.get_routes()
except (HTTPError, OSError, socket.error) as e:
if isinstance(e, HTTPError) and e.code == 403:
msg = "Did CONFIGPROXY_AUTH_TOKEN change?"
@@ -1124,6 +1124,7 @@ class JupyterHub(Application):
return
else:
self.log.info("Proxy already running at: %s", self.proxy.public_server.bind_url)
yield self.proxy.check_routes(self.users, self._service_map, routes)
self.proxy_process = None
return