mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-17 06:52:59 +00:00
More cleanup
This commit is contained in:
@@ -368,7 +368,7 @@ class BaseHandler(RequestHandler):
|
||||
raise RuntimeError("Spawn already pending for: %s" % user.name)
|
||||
|
||||
concurrent_spawn_limit = self.settings['concurrent_spawn_limit']
|
||||
if concurrent_spawn_limit is not None and self.hub.spawn_pending_count > concurrent_spawn_limit:
|
||||
if concurrent_spawn_limit and self.settings.get('_spawn_pending_count', 0) > concurrent_spawn_limit:
|
||||
self.log.info(
|
||||
'More than %s pending spawns, throttling',
|
||||
self.settings['concurrent_spawn_limit']
|
||||
@@ -377,7 +377,8 @@ class BaseHandler(RequestHandler):
|
||||
429,
|
||||
"User startup rate limit exceeded. Try to start again in a few minutes.")
|
||||
|
||||
self.hub.spawn_pending_count += 1
|
||||
# FIXME: Move this out of settings, since this isn't really a setting
|
||||
self.settings['_spawn_pending_count'] = self.settings.get('_spawn_pending_count', 0) + 1
|
||||
tic = IOLoop.current().time()
|
||||
user_server_name = user.name
|
||||
if server_name:
|
||||
@@ -414,7 +415,7 @@ class BaseHandler(RequestHandler):
|
||||
spawner.add_poll_callback(self.user_stopped, user)
|
||||
finally:
|
||||
spawner._proxy_pending = False
|
||||
self.hub.spawn_pending_count -= 1
|
||||
self.settings['_spawn_pending_count'] -= 1
|
||||
|
||||
try:
|
||||
yield gen.with_timeout(timedelta(seconds=self.slow_spawn_timeout), f)
|
||||
|
Reference in New Issue
Block a user