Add acquireLoginSession API for Azdata (#13985)

* wip

* fix tests

* add tests

* PR comments
This commit is contained in:
Charles Gagnon
2021-01-20 10:35:26 -08:00
committed by GitHub
parent 9e9fac2991
commit 04dff9cdf2
16 changed files with 488 additions and 188 deletions

View File

@@ -155,18 +155,23 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
cancellable: false
},
async (_progress, _token): Promise<void> => {
let session: azdataExt.AzdataSession | undefined = undefined;
try {
await this._postgresModel.controllerModel.azdataLogin();
session = await this._postgresModel.controllerModel.acquireAzdataSession();
await this._azdataApi.azdata.arc.postgres.server.edit(
this._postgresModel.info.name,
this.saveArgs,
this._postgresModel.engineVersion
this._postgresModel.engineVersion,
this._postgresModel.controllerModel.azdataAdditionalEnvVars,
session
);
} catch (err) {
// If an error occurs while editing the instance then re-enable the save button since
// the edit wasn't successfully applied
this.saveButton!.enabled = true;
throw err;
} finally {
session?.dispose();
}
await this._postgresModel.refresh();
}