mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-19 09:35:36 -05:00
Have MSSQL extension wait for SqlToolsService ready before finishing activation (#7087)
* Have mssql activate wait for service to be ready before returning * Change to using deferred promise * Await on server ready * Finish removing old code * More cleanup * Go back to exposed promise API * Make property readonly * Add missing file * Add back in deleted stuff * Go back to awaiting
This commit is contained in:
@@ -40,7 +40,7 @@ export class SqlToolsServer {
|
||||
let clientOptions = getClientOptions(context);
|
||||
this.client = new SqlOpsDataClient(Constants.serviceName, serverOptions, clientOptions);
|
||||
const processStart = Date.now();
|
||||
this.client.onReady().then(() => {
|
||||
const clientReadyPromise = this.client.onReady().then(() => {
|
||||
const processEnd = Date.now();
|
||||
statusView.text = localize('serviceStartedStatusMsg', "{0} Started", Constants.serviceName);
|
||||
setTimeout(() => {
|
||||
@@ -59,7 +59,7 @@ export class SqlToolsServer {
|
||||
statusView.show();
|
||||
statusView.text = localize('startingServiceStatusMsg', "Starting {0}", Constants.serviceName);
|
||||
this.client.start();
|
||||
await this.activateFeatures(context);
|
||||
await Promise.all([this.activateFeatures(context), clientReadyPromise]);
|
||||
return this.client;
|
||||
} catch (e) {
|
||||
Telemetry.sendTelemetryEvent('ServiceInitializingFailed');
|
||||
|
||||
Reference in New Issue
Block a user