From bbee4a1f383c639137b18f9157d326e1e19fe6c1 Mon Sep 17 00:00:00 2001 From: Lucy Zhang Date: Fri, 26 Mar 2021 15:04:08 -0700 Subject: [PATCH] only restart server if there is an active session (#14885) --- .../workbench/contrib/notebook/browser/notebook.contribution.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sql/workbench/contrib/notebook/browser/notebook.contribution.ts b/src/sql/workbench/contrib/notebook/browser/notebook.contribution.ts index 0f15ace551..ccbf798929 100644 --- a/src/sql/workbench/contrib/notebook/browser/notebook.contribution.ts +++ b/src/sql/workbench/contrib/notebook/browser/notebook.contribution.ts @@ -182,7 +182,7 @@ CommandsRegistry.registerCommand({ for (let editor of editors) { if (editor instanceof NotebookInput) { let model: INotebookModel = editor.notebookModel; - if (model.providerId === 'jupyter') { + if (model.providerId === 'jupyter' && model.clientSession.isReady) { // Jupyter server needs to be restarted so that the correct Python installation is used if (!jupyterServerRestarted) { let jupyterNotebookManager: INotebookManager = model.notebookManagers.find(x => x.providerId === 'jupyter');