diff --git a/jupyterhub/app.py b/jupyterhub/app.py index 2aae6383..af394990 100644 --- a/jupyterhub/app.py +++ b/jupyterhub/app.py @@ -2120,7 +2120,7 @@ class JupyterHub(Application): self.log.debug( "Awaiting checks for %i possibly-running spawners", len(check_futures) ) - await gen.multi(check_futures) + await asyncio.gather(*check_futures) db.commit() # only perform this query if we are going to log it diff --git a/jupyterhub/proxy.py b/jupyterhub/proxy.py index 5b8d386a..973efa02 100644 --- a/jupyterhub/proxy.py +++ b/jupyterhub/proxy.py @@ -25,7 +25,6 @@ from functools import wraps from subprocess import Popen from urllib.parse import quote -from tornado import gen from tornado.httpclient import AsyncHTTPClient from tornado.httpclient import HTTPError from tornado.httpclient import HTTPRequest @@ -292,7 +291,7 @@ class Proxy(LoggingConfigurable): if service.server: futures.append(self.add_service(service)) # wait after submitting them all - await gen.multi(futures) + await asyncio.gather(*futures) async def add_all_users(self, user_dict): """Update the proxy table from the database. @@ -305,7 +304,7 @@ class Proxy(LoggingConfigurable): if spawner.ready: futures.append(self.add_user(user, name)) # wait after submitting them all - await gen.multi(futures) + await asyncio.gather(*futures) @_one_at_a_time async def check_routes(self, user_dict, service_dict, routes=None): @@ -391,7 +390,7 @@ class Proxy(LoggingConfigurable): self.log.warning("Deleting stale route %s", routespec) futures.append(self.delete_route(routespec)) - await gen.multi(futures) + await asyncio.gather(*futures) stop = time.perf_counter() # timer stops here when user is deleted CHECK_ROUTES_DURATION_SECONDS.observe(stop - start) # histogram metric diff --git a/jupyterhub/tests/test_api.py b/jupyterhub/tests/test_api.py index 3f38bf40..f8c647ec 100644 --- a/jupyterhub/tests/test_api.py +++ b/jupyterhub/tests/test_api.py @@ -13,7 +13,6 @@ from urllib.parse import urlparse from async_generator import async_generator from async_generator import yield_ from pytest import mark -from tornado import gen import jupyterhub from .. import orm