Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/client/datascience/interactive-common/interactiveBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1322,10 +1322,10 @@ export abstract class InteractiveBase extends WebViewHost<IInteractiveWindowMapp
await this.switchKernelWithRetry(kernel);
}
}
private async switchKernelWithRetry(kernel: KernelSpecInterpreter){
private async switchKernelWithRetry(kernel: KernelSpecInterpreter) {
const settings = this.configuration.getSettings();
const isLocalConnection = this.notebook?.server.getConnectionInfo()?.localLaunch ?? settings.datascience.jupyterServerURI.toLowerCase() === Settings.JupyterServerLocalLaunch;
if (!isLocalConnection){
if (!isLocalConnection) {
return this.switchKernel(kernel);
}

Expand All @@ -1336,6 +1336,7 @@ export abstract class InteractiveBase extends WebViewHost<IInteractiveWindowMapp
while (true) {
try {
await this.switchKernel(kernel);
break;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

F***... Thanks

} catch (ex) {
if (ex instanceof JupyterSessionStartError && isLocalConnection) {
// Looks like we were unable to start a session for the local connection.
Expand All @@ -1348,7 +1349,7 @@ export abstract class InteractiveBase extends WebViewHost<IInteractiveWindowMapp
const selection = await this.applicationShell.showErrorMessage(message, selectKernel, cancel);
if (selection === selectKernel) {
kernel = await this.dataScience.selectLocalJupyterKernel(kernel.kernelSpec || kernel.kernelModel);
if (Object.keys(kernel).length > 0){
if (Object.keys(kernel).length > 0) {
continue;
}
}
Expand Down