Skip to content

Commit 792d659

Browse files
committed
Apply ensure_async to a couple session handlers
1 parent 3135bd6 commit 792d659

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jupyter_server/services/sessions/handlers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class SessionRootHandler(APIHandler):
2222
async def get(self):
2323
# Return a list of running sessions
2424
sm = self.session_manager
25-
sessions = await sm.list_sessions()
25+
sessions = await ensure_async(sm.list_sessions())
2626
self.finish(json.dumps(sessions, default=date_default))
2727

2828
@web.authenticated
@@ -59,7 +59,7 @@ async def post(self):
5959
self.log.debug("No kernel specified, using default kernel")
6060
kernel_name = None
6161

62-
exists = await sm.session_exists(path=path)
62+
exists = await ensure_async(sm.session_exists(path=path))
6363
if exists:
6464
model = await sm.get_session(path=path)
6565
else:

0 commit comments

Comments
 (0)