diff --git a/src/main/java/org/warp/commonutils/concurrency/executor/AsyncStackTraceExecutorServiceDecorator.java b/src/main/java/org/warp/commonutils/concurrency/executor/AsyncStackTraceExecutorServiceDecorator.java index 5fac5a2..d4be997 100644 --- a/src/main/java/org/warp/commonutils/concurrency/executor/AsyncStackTraceExecutorServiceDecorator.java +++ b/src/main/java/org/warp/commonutils/concurrency/executor/AsyncStackTraceExecutorServiceDecorator.java @@ -5,8 +5,15 @@ import org.jetbrains.annotations.NotNull; public class AsyncStackTraceExecutorServiceDecorator extends SimplerExecutorServiceDecorator { + // todo: Fix async stacktrace performance and memory problems + private static final boolean DISABLE_ASYNC_STACKTRACES_GLOBALLY = true; + public AsyncStackTraceExecutorServiceDecorator(ExecutorService executorService) { super(executorService, (executor) -> { + if (DISABLE_ASYNC_STACKTRACES_GLOBALLY) { + return executor; + } + // Do nothing if it has already the asyncstacktrace executor service decorator if (executorService instanceof ExecutorServiceDecorator) { var decorators = ((ExecutorServiceDecorator) executorService).getExecutorServiceDecorators(); diff --git a/src/main/java/org/warp/commonutils/concurrency/executor/SimplerExecutorServiceDecorator.java b/src/main/java/org/warp/commonutils/concurrency/executor/SimplerExecutorServiceDecorator.java index 58e7f18..ecac3fa 100644 --- a/src/main/java/org/warp/commonutils/concurrency/executor/SimplerExecutorServiceDecorator.java +++ b/src/main/java/org/warp/commonutils/concurrency/executor/SimplerExecutorServiceDecorator.java @@ -14,10 +14,10 @@ import org.jetbrains.annotations.NotNull; public abstract class SimplerExecutorServiceDecorator extends ExecutorServiceDecorator { - private final ExecutorDecorator executorDecorator; + private final Executor executorDecorator; public SimplerExecutorServiceDecorator(ExecutorService executorService, - Function executorDecoratorInitializer) { + Function executorDecoratorInitializer) { super(executorService); this.executorDecorator = executorDecoratorInitializer.apply(executorService); }