From 880833ecffde92f88c64ab44b218dcd5f2a67e07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8E=E1=85=AC=E1=84=89=E1=85=AE=E1=84=8B=E1=85=AF?= =?UTF-8?q?=E1=86=AB?= Date: Fri, 5 Apr 2024 12:37:01 +0900 Subject: [PATCH] =?UTF-8?q?remove:=20AsyncConfig=20=ED=95=84=EC=9A=94?= =?UTF-8?q?=EC=97=86=EB=8A=94=20=EC=BD=94=EB=93=9C=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/b1nd/dodaminfra/async/AsyncConfig.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/dodam-infra/src/main/java/b1nd/dodaminfra/async/AsyncConfig.java b/dodam-infra/src/main/java/b1nd/dodaminfra/async/AsyncConfig.java index e71a8ddc..c6f50791 100644 --- a/dodam-infra/src/main/java/b1nd/dodaminfra/async/AsyncConfig.java +++ b/dodam-infra/src/main/java/b1nd/dodaminfra/async/AsyncConfig.java @@ -2,7 +2,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.scheduling.annotation.AsyncConfigurer; +import org.springframework.context.annotation.Primary; import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; @@ -11,10 +11,11 @@ @Configuration @EnableAsync -class AsyncConfig implements AsyncConfigurer { +class AsyncConfig { - @Override - public Executor getAsyncExecutor() { + @Bean + @Primary + public Executor asyncExecutor() { ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); executor.setCorePoolSize(20); executor.setMaxPoolSize(50); @@ -25,9 +26,4 @@ public Executor getAsyncExecutor() { return executor; } - @Bean - public Executor asyncExecutor() { - return getAsyncExecutor(); - } - -} \ No newline at end of file +}