mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-16 06:22:59 +00:00
periodically poll single-user servers
If they aren't running, unregister them and remove them from the proxy so that future logins are handled by the hub, and spawn new servers.
This commit is contained in:
@@ -169,8 +169,18 @@ class BaseHandler(RequestHandler):
|
||||
config=self.config,
|
||||
)
|
||||
yield self.proxy.add_user(user)
|
||||
user.spawner.add_poll_callback(self.user_stopped, user)
|
||||
raise gen.Return(user)
|
||||
|
||||
@gen.coroutine
|
||||
def user_stopped(self, user):
|
||||
status = yield user.spawner.poll()
|
||||
self.log.warn("User %s server stopped, with exit code: %s",
|
||||
user.name, status,
|
||||
)
|
||||
yield self.proxy.delete_user(user)
|
||||
yield user.stop()
|
||||
|
||||
@gen.coroutine
|
||||
def stop_single_user(self, user):
|
||||
yield self.proxy.delete_user(user)
|
||||
|
Reference in New Issue
Block a user