mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-15 05:53:00 +00:00
implement progress on spawn_pending page
- add Spawner.progress method. Must be an async generator of JSON-able progress events - add /api/users/:user/server-progress eventstream endpoint - use eventstream to fill progress bar on the spawn pending page
This commit is contained in:
@@ -887,11 +887,21 @@ class UserSpawnHandler(BaseHandler):
|
||||
pass
|
||||
|
||||
# we may have waited above, check pending again:
|
||||
progress_url = url_path_join(
|
||||
self.hub.base_url, 'api/users',
|
||||
user.escaped_name, 'server-progress', spawner.name,
|
||||
)
|
||||
|
||||
if spawner.pending:
|
||||
self.log.info("%s is pending %s", spawner._log_name, spawner.pending)
|
||||
# spawn has started, but not finished
|
||||
self.statsd.incr('redirects.user_spawn_pending', 1)
|
||||
html = self.render_template("spawn_pending.html", user=user)
|
||||
url_parts = []
|
||||
html = self.render_template(
|
||||
"spawn_pending.html",
|
||||
user=user,
|
||||
progress_url=progress_url,
|
||||
)
|
||||
self.finish(html)
|
||||
return
|
||||
|
||||
@@ -919,7 +929,11 @@ class UserSpawnHandler(BaseHandler):
|
||||
self.log.info("%s is pending %s", spawner._log_name, spawner.pending)
|
||||
# spawn has started, but not finished
|
||||
self.statsd.incr('redirects.user_spawn_pending', 1)
|
||||
html = self.render_template("spawn_pending.html", user=user)
|
||||
html = self.render_template(
|
||||
"spawn_pending.html",
|
||||
user=user,
|
||||
progress_url=progress_url,
|
||||
)
|
||||
self.finish(html)
|
||||
return
|
||||
|
||||
|
Reference in New Issue
Block a user