Feature/schemacompare cancel (#6104)

* Schema compare cancel changes for ADS

* adding a missed change

* Merge from Master

* Updating SqltoolsService version

* trying stress with bigger runtime

* trying one more stress fix with unique operation ids

* refactoring test a bit to ensure stress run works
This commit is contained in:
Udeesha Gautam
2019-06-21 13:55:01 -07:00
committed by GitHub
parent 83410565da
commit 4c1af148c7
13 changed files with 350 additions and 149 deletions

View File

@@ -167,8 +167,8 @@ export class SchemaCompareServicesFeature extends SqlOpsFeature<undefined> {
protected registerProvider(options: undefined): Disposable {
const client = this._client;
let schemaCompare = (sourceEndpointInfo: azdata.SchemaCompareEndpointInfo, targetEndpointInfo: azdata.SchemaCompareEndpointInfo, taskExecutionMode: azdata.TaskExecutionMode, deploymentOptions: azdata.DeploymentOptions): Thenable<azdata.SchemaCompareResult> => {
let params: contracts.SchemaCompareParams = { sourceEndpointInfo: sourceEndpointInfo, targetEndpointInfo: targetEndpointInfo, taskExecutionMode: taskExecutionMode, deploymentOptions: deploymentOptions };
let schemaCompare = (operationId: string, sourceEndpointInfo: azdata.SchemaCompareEndpointInfo, targetEndpointInfo: azdata.SchemaCompareEndpointInfo, taskExecutionMode: azdata.TaskExecutionMode, deploymentOptions: azdata.DeploymentOptions): Thenable<azdata.SchemaCompareResult> => {
let params: contracts.SchemaCompareParams = { operationId: operationId, sourceEndpointInfo: sourceEndpointInfo, targetEndpointInfo: targetEndpointInfo, taskExecutionMode: taskExecutionMode, deploymentOptions: deploymentOptions };
return client.sendRequest(contracts.SchemaCompareRequest.type, params).then(
r => {
return r;
@@ -232,13 +232,27 @@ export class SchemaCompareServicesFeature extends SqlOpsFeature<undefined> {
);
};
let schemaCompareCancel = (operationId: string): Thenable<azdata.ResultStatus> => {
let params: contracts.SchemaCompareCancelParams = { operationId: operationId };
return client.sendRequest(contracts.SchemaCompareCancellationRequest.type, params).then(
r => {
return r;
},
e => {
client.logFailedRequest(contracts.SchemaCompareCancellationRequest.type, e);
return Promise.resolve(undefined);
}
);
};
return azdata.dataprotocol.registerSchemaCompareServicesProvider({
providerId: client.providerId,
schemaCompare,
schemaCompareGenerateScript,
schemaComparePublishChanges,
schemaCompareGetDefaultOptions,
schemaCompareIncludeExcludeNode
schemaCompareIncludeExcludeNode,
schemaCompareCancel
});
}
}