Skip to content

Commit

Permalink
Update kernel env to reflect changes in session (#1354)
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Nov 6, 2023
1 parent 5c5b501 commit e71e958
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions jupyter_server/services/sessions/sessionmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,13 @@ async def update_session(self, session_id, **kwargs):
query = "UPDATE session SET %s WHERE session_id=?" % (", ".join(sets)) # noqa
self.cursor.execute(query, [*list(kwargs.values()), session_id])

if hasattr(self.kernel_manager, "update_env"):
self.cursor.execute(
"SELECT path, name, kernel_id FROM session WHERE session_id=?", [session_id]
)
path, name, kernel_id = self.cursor.fetchone()
self.kernel_manager.update_env(kernel_id=kernel_id, env=self.get_kernel_env(path, name))

async def kernel_culled(self, kernel_id: str) -> bool:
"""Checks if the kernel is still considered alive and returns true if its not found."""
return kernel_id not in self.kernel_manager
Expand Down

0 comments on commit e71e958

Please sign in to comment.