Fix Per Request Cancellation Tokens

While working on https://github.com/Microsoft/vscode/pull/22437, I believe there is a bug in the per request cancellation in the  `setRequest` function on the line `currentRequestId = currentRequestId ;` This causes `currentRequestId` to always be undefined

Fix is to assign the `currentRequestId` to `requestId`
This commit is contained in:
Matt Bierner 2017-03-10 22:13:58 -08:00 committed by Mohamed Hegazy
parent 8f41444769
commit 7ea8d9fa49

View File

@ -48,7 +48,7 @@ function createCancellationToken(args: string[]): ServerCancellationToken {
return {
isCancellationRequested: () => perRequestPipeName !== undefined && pipeExists(perRequestPipeName),
setRequest(requestId: number) {
currentRequestId = currentRequestId;
currentRequestId = requestId;
perRequestPipeName = namePrefix + requestId;
},
resetRequest(requestId: number) {
@ -67,4 +67,4 @@ function createCancellationToken(args: string[]): ServerCancellationToken {
};
}
}
export = createCancellationToken;
export = createCancellationToken;