mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Fix hang when expanding arc tree node without azdata (#14033)
This commit is contained in:
@@ -8,7 +8,6 @@ import * as azdataExt from 'azdata-ext';
|
|||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
import { UserCancelledError } from '../common/api';
|
import { UserCancelledError } from '../common/api';
|
||||||
import { getCurrentClusterContext, getKubeConfigClusterContexts } from '../common/kubeUtils';
|
import { getCurrentClusterContext, getKubeConfigClusterContexts } from '../common/kubeUtils';
|
||||||
import { Deferred } from '../common/promise';
|
|
||||||
import * as loc from '../localizedConstants';
|
import * as loc from '../localizedConstants';
|
||||||
import { ConnectToControllerDialog } from '../ui/dialogs/connectControllerDialog';
|
import { ConnectToControllerDialog } from '../ui/dialogs/connectControllerDialog';
|
||||||
import { AzureArcTreeDataProvider } from '../ui/tree/azureArcTreeDataProvider';
|
import { AzureArcTreeDataProvider } from '../ui/tree/azureArcTreeDataProvider';
|
||||||
@@ -24,7 +23,6 @@ export class ControllerModel {
|
|||||||
private _endpoints: azdataExt.DcEndpointListResult[] = [];
|
private _endpoints: azdataExt.DcEndpointListResult[] = [];
|
||||||
private _registrations: Registration[] = [];
|
private _registrations: Registration[] = [];
|
||||||
private _controllerConfig: azdataExt.DcConfigShowResult | undefined = undefined;
|
private _controllerConfig: azdataExt.DcConfigShowResult | undefined = undefined;
|
||||||
private static _refreshInProgress: Deferred<void> | undefined = undefined;
|
|
||||||
|
|
||||||
private readonly _onConfigUpdated = new vscode.EventEmitter<azdataExt.DcConfigShowResult | undefined>();
|
private readonly _onConfigUpdated = new vscode.EventEmitter<azdataExt.DcConfigShowResult | undefined>();
|
||||||
private readonly _onEndpointsUpdated = new vscode.EventEmitter<azdataExt.DcEndpointListResult[]>();
|
private readonly _onEndpointsUpdated = new vscode.EventEmitter<azdataExt.DcEndpointListResult[]>();
|
||||||
@@ -118,12 +116,6 @@ export class ControllerModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
public async refresh(showErrors: boolean = true, promptReconnect: boolean = false): Promise<void> {
|
public async refresh(showErrors: boolean = true, promptReconnect: boolean = false): Promise<void> {
|
||||||
//wait for any previous refresh that might be in progress to finish
|
|
||||||
if (ControllerModel._refreshInProgress) {
|
|
||||||
await ControllerModel._refreshInProgress;
|
|
||||||
}
|
|
||||||
// create a new in progress promise object
|
|
||||||
ControllerModel._refreshInProgress = new Deferred<void>();
|
|
||||||
const session = await this.acquireAzdataSession(promptReconnect);
|
const session = await this.acquireAzdataSession(promptReconnect);
|
||||||
const newRegistrations: Registration[] = [];
|
const newRegistrations: Registration[] = [];
|
||||||
try {
|
try {
|
||||||
@@ -183,8 +175,6 @@ export class ControllerModel {
|
|||||||
]);
|
]);
|
||||||
} finally {
|
} finally {
|
||||||
session.dispose();
|
session.dispose();
|
||||||
ControllerModel._refreshInProgress.resolve();
|
|
||||||
ControllerModel._refreshInProgress = undefined;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user