Make auto-configured applicationTaskExecutor bean lazy

See gh-14934
pull/14934/merge
artsiom 6 years ago committed by Andy Wilkinson
parent de674db454
commit 4f92e857e9

@ -27,6 +27,7 @@ import org.springframework.boot.task.TaskExecutorBuilder;
import org.springframework.boot.task.TaskExecutorCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.task.TaskDecorator;
import org.springframework.core.task.TaskExecutor;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
@ -77,6 +78,7 @@ public class TaskExecutionAutoConfiguration {
return builder;
}
@Lazy
@Bean(name = APPLICATION_TASK_EXECUTOR_BEAN_NAME)
@ConditionalOnMissingBean(Executor.class)
public ThreadPoolTaskExecutor applicationTaskExecutor(TaskExecutorBuilder builder) {

Loading…
Cancel
Save