Skip to content

Commit

Permalink
Fix Per Request Cancellation Tokens
Browse files Browse the repository at this point in the history
While working on microsoft/vscode#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`
  • Loading branch information
mjbvz authored and mhegazy committed Mar 13, 2017
1 parent 8f41444 commit 7ea8d9f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server/cancellationToken/cancellationToken.ts
Expand Up @@ -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) {
Expand All @@ -67,4 +67,4 @@ function createCancellationToken(args: string[]): ServerCancellationToken {
};
}
}
export = createCancellationToken;
export = createCancellationToken;

0 comments on commit 7ea8d9f

Please sign in to comment.