mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-29 17:23:25 -05:00
Wait for all notebook models to load before shutting down active sessions during python upgrade (#17766)
* handle undefined model * wait for kernel to load before restart * comment * await editor model resolved * remove cast
This commit is contained in:
@@ -223,6 +223,9 @@ CommandsRegistry.registerCommand({
|
||||
|
||||
for (let editor of editors) {
|
||||
if (editor instanceof NotebookInput) {
|
||||
// Wait for NotebookInput.resolve() to be called to ensure the _model field in NotebookInput
|
||||
// is not undefined when trying to get the notebookModel.
|
||||
await editor.modelResolved;
|
||||
let model: INotebookModel = editor.notebookModel;
|
||||
if (model?.providerId === JUPYTER_PROVIDER_ID) {
|
||||
let jupyterNotebookManager: IExecuteManager = model.executeManagers.find(x => x.providerId === JUPYTER_PROVIDER_ID);
|
||||
|
||||
Reference in New Issue
Block a user