mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-17 23:13:00 +00:00
add waiting_for_response indicator on User
.spawn_pending used for the *whole* window, from request to responsive (added to proxy) .waiting_for_response is just used for the window between Spawner.start returning (process started, http endpoint known) and http endpoint becoming responsive .waiting_for_response will never be True while .spawn_pending is False
This commit is contained in:
@@ -99,6 +99,7 @@ class User(HasTraits):
|
||||
spawner = None
|
||||
spawn_pending = False
|
||||
stop_pending = False
|
||||
waiting_for_response = False
|
||||
|
||||
@property
|
||||
def authenticator(self):
|
||||
@@ -258,6 +259,7 @@ class User(HasTraits):
|
||||
self.state = spawner.get_state()
|
||||
self.last_activity = datetime.utcnow()
|
||||
db.commit()
|
||||
self.waiting_for_response = True
|
||||
try:
|
||||
yield self.server.wait_up(http=True, timeout=spawner.http_timeout)
|
||||
except Exception as e:
|
||||
@@ -284,7 +286,9 @@ class User(HasTraits):
|
||||
), exc_info=True)
|
||||
# raise original TimeoutError
|
||||
raise e
|
||||
self.spawn_pending = False
|
||||
finally:
|
||||
self.waiting_for_response = False
|
||||
self.spawn_pending = False
|
||||
return self
|
||||
|
||||
@gen.coroutine
|
||||
|
Reference in New Issue
Block a user