Merge pull request #132523 from AkatQuas/fix/runner

fix: early return on cancellation
This commit is contained in:
Martin Aeschlimann
2021-09-09 09:42:04 +02:00
committed by GitHub
3 changed files with 3 additions and 0 deletions

View File

@@ -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) {