Skip to content

Commit

Permalink
use done
Browse files Browse the repository at this point in the history
  • Loading branch information
sigmarkarl committed Nov 3, 2023
1 parent 7cc250c commit 5978122
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions jupyter_server/services/sessions/sessionmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,7 @@ async def start_kernel_for_session(
if self.fut_kernel_id_dict is not None:
if session_id in self.fut_kernel_id_dict:
fut_kernel_id = self.fut_kernel_id_dict[session_id]
done, pending = await asyncio.wait({fut_kernel_id})
if fut_kernel_id in done:
if fut_kernel_id.done():
kernel_id = await fut_kernel_id
self.fut_kernel_id_dict.pop(session_id)
return kernel_id
Expand Down Expand Up @@ -430,11 +429,10 @@ async def get_session(self, **kwargs):
session_id = kwargs["session_id"]
if self.fut_kernel_id_dict is not None and session_id in self.fut_kernel_id_dict:
model = {
"id": "waiting",
"session_id": session_id,
"id": session_id,
"name": "Waiting for kernel to start",
"last_activity": None,
"execution_state": "starting",
"execution_state": "waiting",
"connections": 0,
}
else:
Expand Down

0 comments on commit 5978122

Please sign in to comment.