mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Fix duplicate arc instance nodes (#12381)
This commit is contained in:
@@ -93,7 +93,7 @@ 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> {
|
||||||
await this.azdataLogin(promptReconnect);
|
await this.azdataLogin(promptReconnect);
|
||||||
this._registrations = [];
|
const newRegistrations: Registration[] = [];
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
this._azdataApi.azdata.arc.dc.config.show().then(result => {
|
this._azdataApi.azdata.arc.dc.config.show().then(result => {
|
||||||
this._controllerConfig = result.result;
|
this._controllerConfig = result.result;
|
||||||
@@ -125,7 +125,7 @@ export class ControllerModel {
|
|||||||
}),
|
}),
|
||||||
Promise.all([
|
Promise.all([
|
||||||
this._azdataApi.azdata.arc.postgres.server.list().then(result => {
|
this._azdataApi.azdata.arc.postgres.server.list().then(result => {
|
||||||
this._registrations.push(...result.result.map(r => {
|
newRegistrations.push(...result.result.map(r => {
|
||||||
return {
|
return {
|
||||||
instanceName: r.name,
|
instanceName: r.name,
|
||||||
state: r.state,
|
state: r.state,
|
||||||
@@ -134,7 +134,7 @@ export class ControllerModel {
|
|||||||
}));
|
}));
|
||||||
}),
|
}),
|
||||||
this._azdataApi.azdata.arc.sql.mi.list().then(result => {
|
this._azdataApi.azdata.arc.sql.mi.list().then(result => {
|
||||||
this._registrations.push(...result.result.map(r => {
|
newRegistrations.push(...result.result.map(r => {
|
||||||
return {
|
return {
|
||||||
instanceName: r.name,
|
instanceName: r.name,
|
||||||
state: r.state,
|
state: r.state,
|
||||||
@@ -143,6 +143,7 @@ export class ControllerModel {
|
|||||||
}));
|
}));
|
||||||
})
|
})
|
||||||
]).then(() => {
|
]).then(() => {
|
||||||
|
this._registrations = newRegistrations;
|
||||||
this.registrationsLastUpdated = new Date();
|
this.registrationsLastUpdated = new Date();
|
||||||
this._onRegistrationsUpdated.fire(this._registrations);
|
this._onRegistrationsUpdated.fire(this._registrations);
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user