Disabled async stacktraces temporarily

This commit is contained in:
Andrea Cavalli 2020-08-26 16:30:14 +02:00
parent a6b9037507
commit 816e9db448
2 changed files with 9 additions and 2 deletions

View File

@ -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();

View File

@ -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<Executor, ExecutorDecorator> executorDecoratorInitializer) {
Function<Executor, Executor> executorDecoratorInitializer) {
super(executorService);
this.executorDecorator = executorDecoratorInitializer.apply(executorService);
}