From e186b5a3a81b744a2fbe96675bb2068c712f1f3b Mon Sep 17 00:00:00 2001 From: Min RK Date: Wed, 7 Jan 2015 15:47:04 -0800 Subject: [PATCH] add_user can be async in Hub.init_users --- jupyterhub/app.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/jupyterhub/app.py b/jupyterhub/app.py index b4f6f1e1..93e18004 100644 --- a/jupyterhub/app.py +++ b/jupyterhub/app.py @@ -543,14 +543,14 @@ class JupyterHub(Application): # From this point on, any user changes should be done simultaneously # to the whitelist set and user db, unless the whitelist is empty (all users allowed). - db.commit() - for user in new_users: - self.authenticator.add_user(user) - db.commit() - # load any still-active spawners from JSON run_sync = IOLoop().run_sync + db.commit() + for user in new_users: + run_sync(lambda : self.authenticator.add_user(user)) + db.commit() + user_summaries = [''] def _user_summary(user): parts = ['{0: >8}'.format(user.name)]