Skip to content

Commit

Permalink
Revert "Revert "Update kernel env to reflect changes in session." (#1346
Browse files Browse the repository at this point in the history
)"

This reverts commit bb293ec.
  • Loading branch information
blink1073 authored Oct 25, 2023
1 parent bb293ec commit 4b9b411
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 4b9b411

Please sign in to comment.