mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 20:26:08 +00:00
Merge pull request #132523 from AkatQuas/fix/runner
fix: early return on cancellation
This commit is contained in:
@@ -23,6 +23,7 @@ export function runSafe<T>(runtime: RuntimeEnvironment, func: () => Thenable<T>,
|
||||
runtime.timer.setImmediate(() => {
|
||||
if (token.isCancellationRequested) {
|
||||
resolve(cancelValue());
|
||||
return;
|
||||
}
|
||||
return func().then(result => {
|
||||
if (token.isCancellationRequested) {
|
||||
|
||||
Reference in New Issue
Block a user