|
37 | 37 | import java.util.function.Supplier; |
38 | 38 |
|
39 | 39 | import static graphql.Assert.assertTrue; |
40 | | -import static graphql.execution.EngineRunningObserver.RunningState.CANCELLED; |
41 | 40 | import static graphql.execution.EngineRunningObserver.RunningState.NOT_RUNNING; |
42 | 41 | import static graphql.execution.EngineRunningObserver.RunningState.RUNNING; |
43 | 42 |
|
@@ -378,15 +377,13 @@ public boolean isRunning() { |
378 | 377 | } |
379 | 378 |
|
380 | 379 | private void incrementRunning(Throwable throwable) { |
381 | | - checkIsCancelled(throwable); |
382 | 380 | assertTrue(isRunning.get() >= 0); |
383 | 381 | if (isRunning.incrementAndGet() == 1) { |
384 | 382 | changeOfState(RUNNING); |
385 | 383 | } |
386 | 384 | } |
387 | 385 |
|
388 | 386 | private void decrementRunning(Throwable throwable) { |
389 | | - checkIsCancelled(throwable); |
390 | 387 | assertTrue(isRunning.get() > 0); |
391 | 388 | if (isRunning.decrementAndGet() == 0) { |
392 | 389 | changeOfState(NOT_RUNNING); |
@@ -438,25 +435,6 @@ public void run(Throwable throwable, Runnable runnable) { |
438 | 435 | } |
439 | 436 | } |
440 | 437 |
|
441 | | - private void checkIsCancelled(Throwable currentThrowable) { |
442 | | - // no need to check we are cancelled if we already have an exception in play |
443 | | - // since it can lead to an exception being thrown when an exception has already been |
444 | | - // thrown |
445 | | - if (currentThrowable == null) { |
446 | | - checkIsCancelled(); |
447 | | - } |
448 | | - } |
449 | | - |
450 | | - /** |
451 | | - * This will abort the execution via {@link AbortExecutionException} if the {@link ExecutionInput} has been cancelled |
452 | | - */ |
453 | | - private void checkIsCancelled() { |
454 | | - if (executionInput.isCancelled()) { |
455 | | - changeOfState(CANCELLED); |
456 | | - throw new AbortExecutionException("Execution has been asked to be cancelled"); |
457 | | - } |
458 | | - } |
459 | | - |
460 | 438 | private void changeOfState(RunningState runningState) { |
461 | 439 | if (engineRunningObserver != null) { |
462 | 440 | engineRunningObserver.runningStateChanged(executionId, graphQLContext, runningState); |
|
0 commit comments