mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-10 19:43:01 +00:00
API: pass 'server_state' through to admin clients only
- This will allow, for example, cull_idle_servers to be more intelligent when culling servers. - This is only given to admin API users, because we don't know if all spawners expect their state to be made available to users.
This commit is contained in:
@@ -207,6 +207,9 @@ def normalize_user(user):
|
||||
for key in ('started', 'last_activity'):
|
||||
server[key] = normalize_timestamp(server[key])
|
||||
server['progress_url'] = re.sub(r'.*/hub/api', 'PREFIX/hub/api', server['progress_url'])
|
||||
if (isinstance(server['state'], dict)
|
||||
and isinstance(server['state'].get('pid', None), int)):
|
||||
server['state']['pid'] = 0
|
||||
return user
|
||||
|
||||
def fill_user(model):
|
||||
|
Reference in New Issue
Block a user